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

Logger Properties

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

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

const options: VWOInitOptions = {
	sdkKey: SDK_KEY,
	accountId: ACCOUNT_ID,
	logLevel: LogLevel.debug
};

// initialize VWO
const vwoClient = await init(options);

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

const options: VWOInitOptions = {
	sdkKey: SDK_KEY,
	accountId: ACCOUNT_ID,
	logLevel: LogLevel.debug,
  logPrefix: "CUSTOM_LOG_PREFIX"
};

// initialize VWO
const vwoClient = await init(options);

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