Log Level

Log Level

Overview  

The PageSense Python SDK includes a built-in logging framework to help monitor SDK initialization, project synchronisation, experiment evaluation, goal tracking, and error conditions. By default, the SDK logs messages at the INFO level. You can configure a different logging level using the add_log_level() method during SDK initialization.
 

Method  

add_log_level(log_level: str)

Parameters  

Parameter
Type
Required
Description
log_level
str
Yes
Logging level to be used by the SDK.

Return Value  

Type
Description
PageSenseSDKOptions
Returns the same SDK options instance to support method chaining.

Usage Example  

from pagesense import PageSenseSDKOptions

sdk_options = (
    PageSenseSDKOptions()
        .add_log_level("DEBUG")
)

Supported Log Levels  

The SDK supports the following logging levels.
Log Level
Description
TRACE
Provides the most detailed diagnostic information. Primarily intended for troubleshooting complex SDK behaviour.
DEBUG
Provides detailed information useful during development and debugging.
INFO
Provides general SDK information. This is the default log level.
WARNING
Reports recoverable issues that do not interrupt SDK execution.
ERROR
Reports errors that may affect SDK functionality.
FATAL
Reports critical failures that prevent normal SDK operation.

Notes  

  • Logging should be configured before initialising the SDK.
  • Log level names are case-sensitive and should match the supported values.
  • The configured log level applies to all SDK logging operations.
Info
Recommendation: Use DEBUG or TRACE only during development or troubleshooting. For production environments, INFO or WARNING is generally recommended.