Skip to main content

Log level

Set how much information the Adtrace SDK writes to the device logs. Configure log level on your ADTConfig instance before you call [Adtrace appDidLaunch:] / Adtrace.appDidLaunch(...).

Method signature

- (void)setLogLevel:(ADTLogLevel)logLevel;

You can also assign the logLevel property directly on ADTConfig.

Available log levels

Log levelDescription
ADTLogLevelVerboseEnable all logging
ADTLogLevelDebugEnable debug logging
ADTLogLevelInfoShow info-level logging (default)
ADTLogLevelWarnDisable informational messages; keep warnings and above
ADTLogLevelErrorDisable warning-level logging and below
ADTLogLevelAssertDisable error-level logging and below
ADTLogLevelSuppressSuppress all logging

Set your log level

ParameterTypeDescription
logLevelADTLogLevelThe log level to use

Example

Call the setter on your ADTConfig instance before appDidLaunch. See Configuration for how to create the config.

[adtraceConfig setLogLevel:ADTLogLevelVerbose];

Or assign the property:

adtraceConfig.logLevel = ADTLogLevelVerbose;

Use ADTLogLevelVerbose while testing. Before release, switch to ADTLogLevelWarn or ADTLogLevelSuppress.

Suppress all logging

To disable all logging in production, set the log level to ADTLogLevelSuppress. You must also pass YES / true as allowSuppressLogLevel when you create ADTConfig.

AppDelegate.m
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADTEnvironmentProduction;
ADTConfig *adtraceConfig = [ADTConfig configWithAppToken:yourAppToken
environment:environment
allowSuppressLogLevel:YES];
[adtraceConfig setLogLevel:ADTLogLevelSuppress];

[Adtrace appDidLaunch:adtraceConfig];