Enable debug logging

Debug logging is an optional, yet critical SDK feature. It helps you ensure that the SDK is working as intended. Below is a table that explains levels of logging available and when they may be used:

Log Level

Description

Error

This log level provides the details about unrecoverable errors that occurred during SDK implementation.

Warning

In addition to the detail from Error log level, Warning provides error information during SDK integration. This log level might indicate that a request has been made to the SDK, but the SDK might be unable to perform the requested task. For example, this log level might be used when catching an unexpected, but recoverable, exception and printing its message.

Debug

In addition to detail from the Warning log level, Debug also provides high-level information about how the SDK processes network requests/responses data.

Verbose

In addition to detail from the Debug level, Verbose provides detailed, low-level information about how SDK processes database interactions and SDK events.

You should only use Error or Warning in the production application, and use Debug or Verbose during devlopement. Using Debug or Verbose in the production application may lead to performace and security issues.

To enable debug logging, use the following methods:

Android
iOS
React Native
Flutter
Android

Java

MobileCore.setLogLevel(LoggingMode.DEBUG);
// MobileCore.setLogLevel(LoggingMode.VERBOSE);
// MobileCore.setLogLevel(LoggingMode.WARNING);
// MobileCore.setLogLevel(LoggingMode.ERROR);
iOS

Objective-C

[ACPCore setLogLevel:ACPMobileLogLevelDebug];
// [ACPCore setLogLevel:ACPMobileLogLevelVerbose];
// [ACPCore setLogLevel:ACPMobileLogLevelWarning];
// [ACPCore setLogLevel:ACPMobileLogLevelError];

Swift

ACPCore.setLogLevel(ACPMobileLogLevel.debug)
// ACPCore.setLogLevel(ACPMobileLogLevel.verbose)
// ACPCore.setLogLevel(ACPMobileLogLevel.warning)
// ACPCore.setLogLevel(ACPMobileLogLevel.error)
React Native

Javascript

ACPCore.setLogLevel(ACPMobileLogLevel.DEBUG);
//ACPCore.setLogLevel(ACPMobileLogLevel.VERBOSE);
//ACPCore.setLogLevel(ACPMobileLogLevel.WARNING);
//ACPCore.setLogLevel(ACPMobileLogLevel.ERROR);
Flutter

Dart

FlutterACPCore.setLogLevel(ACPLoggingLevel.DEBUG);
//FlutterACPCore.setLogLevel(ACPLoggingLevel.VERBOSE);
//FlutterACPCore.setLogLevel(ACPLoggingLevel.WARNING);
//FlutterACPCore.setLogLevel(ACPLoggingLevel.ERROR);