Logging

Wingify by default logs all ERROR level messages to your server's console. To gain more control over Wingify's logging behavior, you can use the logger parameter in the init configuration.

Logger Properties

ParameterTypeDescription
levelStringLevel or Type of error. Could be one of the following: DEBUG, INFO, ERROR, TRACE, WARN
prefixStringThe text that is prefixed to the error messages when logged. Defaults to 'WINGIFY-SDK'.

Example 1: Set log level to control the verbosity of logs

# Set log level
wingify_client = Wingify.init({
    account_id: '123456',
    sdk_key: '32-alpha-numeric-sdk-key',
    logger: {
        level: 'DEBUG'
    }
})

Example 2: Add a custom prefix to log messages for easier identification

# Set log level
wingify_client = Wingify.init({
    account_id: '123456',
    sdk_key: '32-alpha-numeric-sdk-key',
    logger: {
        level: 'DEBUG',
        prefix: 'CUSTOM LOG PREFIX'
    }
})

This "logger" object can be passed as one of the parameters when initializing vwo_client.


Did this page help you?