Extension logging
It is recommended that you use the Experience Platform SDK logging API to print a message from the extension code. The Experience Platform SDKs provide the setLogLevel API, which is used to set one of the following logging modes:
  • VERBOSE
  • DEBUG
  • WARNING
  • ERROR
If the current logging mode is less than verbose, the message is not printed by the Experience Platform SDKs. When debugging and testing your extension, you can set the logging mode to verbose to see all the messages flowing through the Experience Platform SDK.
The Experience Platform SDK uses the extension name as the log tag for the Adobe extensions, so that the application developer can filter the logs for a mobile extension. A similar approach can be implemented by a partner extension as seen in the examples below:
Android
iOS
Java example
1
final String extensionName = "com.example.MyExtension";
2
...
3
ExtensionErrorCallback<ExtensionError> errorCallback = new ExtensionErrorCallback<ExtensionError>() {
4
@Override
5
public void error(final ExtensionError errorCode) {
6
MobileCore.log(LoggingMode.WARNING, extensionName, String.format("An error occurred while registering extension, %s",
7
errorCode.getErrorName()));
8
}
9
};
10
MobileCore.registerExtension(MyExtension.class, errorCallback);
Copied!
Objective-C example
1
NSString* extensionName = @"com.example.MyExtension";
2
...
3
4
NSError *error = nil;
5
if ([ACPCore registerExtension:[MyExtension class] error:&error]) {
6
[ACPCore log:ACPMobileLogLevelDebug tag:extensionName message:@"MyExtension was successfully registered"];
7
} else {
8
[ACPCore log:ACPMobileLogLevelWarning tag:extensionName message:@"An error occurred while attempting to register MyExtension"];
9
}
Copied!

Additional information

To learn more, please read the Mobile SDK logging documentation
Last modified 5mo ago
Export as PDF
Copy link