Skip to main content

Log level

Set how much information the Adtrace SDK writes to the device logs. Configure log level on your AdTraceConfig instance before you call AdTrace.onCreate().

Method signature

public void setLogLevel(LogLevel logLevel)

Available log levels

Log levelDescription
LogLevel.VERBOSEEnable all logging
LogLevel.DEBUGEnable debug logging
LogLevel.INFOShow info-level logging (default)
LogLevel.WARNDisable informational messages; keep warnings and above
LogLevel.ERRORDisable warning-level logging and below
LogLevel.ASSERTDisable error-level logging and below
LogLevel.SUPPRESSSuppress all logging

Set your log level

Call setLogLevel on your AdTraceConfig instance with the logLevel you want.

ParameterTypeDescription
logLevelLogLevelThe log level to use

Example

Call the setter on your AdTraceConfig instance before AdTrace.onCreate(). See Configuration for how to create the config.

import io.adtrace.sdk.LogLevel;

config.setLogLevel(LogLevel.VERBOSE);

Suppress all logging

To disable all logging, set the log level to LogLevel.SUPPRESS. You must also pass true as allowSuppressLogLevel in the AdTraceConfig constructor.

import io.adtrace.sdk.AdTraceConfig;
import io.adtrace.sdk.LogLevel;

AdTraceConfig config = new AdTraceConfig(this, "{YourAppToken}", AdTraceConfig.ENVIRONMENT_PRODUCTION, true);
config.setLogLevel(LogLevel.SUPPRESS);