Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (57 sloc) 2.66 KB

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.

{% hint style="warning" %} 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. {% endhint %}

To enable debug logging, use the following methods:

{% tabs %} {% tab title="Android" %}

Java

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

{% endtab %}

{% tab title="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)

{% endtab %}

{% tab title="React Native" %}

Javascript

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

{% endtab %}

{% tab title="Flutter" %}

Dart

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

{% endtab %} {% endtabs %}

You can’t perform that action at this time.