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 level | Description |
|---|---|
LogLevel.VERBOSE | Enable all logging |
LogLevel.DEBUG | Enable debug logging |
LogLevel.INFO | Show info-level logging (default) |
LogLevel.WARN | Disable informational messages; keep warnings and above |
LogLevel.ERROR | Disable warning-level logging and below |
LogLevel.ASSERT | Disable error-level logging and below |
LogLevel.SUPPRESS | Suppress all logging |
Set your log level
Call setLogLevel on your AdTraceConfig instance with the logLevel you want.
| Parameter | Type | Description |
|---|---|---|
logLevel | LogLevel | The log level to use |
Example
Call the setter on your AdTraceConfig instance before AdTrace.onCreate(). See Configuration for how to create the config.
- Java
- Kotlin
- Javascript
import io.adtrace.sdk.LogLevel;
config.setLogLevel(LogLevel.VERBOSE);
import io.adtrace.sdk.LogLevel
config.setLogLevel(LogLevel.VERBOSE)
config.setLogLevel(AdTraceConfig.LogLevelVerbose);
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.
- Java
- Kotlin
- Javascript
import io.adtrace.sdk.AdTraceConfig;
import io.adtrace.sdk.LogLevel;
AdTraceConfig config = new AdTraceConfig(this, "{YourAppToken}", AdTraceConfig.ENVIRONMENT_PRODUCTION, true);
config.setLogLevel(LogLevel.SUPPRESS);
import io.adtrace.sdk.AdTraceConfig
import io.adtrace.sdk.LogLevel
val config = AdTraceConfig(this, "{YourAppToken}", AdTraceConfig.ENVIRONMENT_PRODUCTION, true)
config.setLogLevel(LogLevel.SUPPRESS)
let config = new AdTraceConfig("{YourAppToken}", AdTraceConfig.EnvironmentProduction, true);
config.setLogLevel(AdTraceConfig.LogLevelSuppress);