Logging and error handling
The logging and error handling features of the Unblu Android mobile SDK help you deal with errors and unexpected behavior that may arise when using the SDK in your app.
Logging
The Unblu SDK uses a configurable internal logger.
The default value of the log level is VERBOSE
. In release builds, however, the VERBOSE
and DEBUG
logs are removed with ProGuard rules.
You can change the log level by means of the Unblu.setLogLevel
method.
By default, the logger doesn’t print any security-relevant information or additional details. To change this behavior for debugging purposes, set Unblu.enableDebugOutput
to true
.
To get logs about mobile co-browsing performance, set Unblu.enableCapturingPerformanceLogging
to true
. For this the log level has to be DEBUG
or less and also the enableDebugOutput
flag has to be enabled.
If, for security reasons, you want to strip out the complete log statements from the compiled app, check out the Log stripping^ section of the article Security-relevant configuration^ first.
Error handling
Errors can occur either during initialization or at runtime. The error types are defined in the package com.unblu.sdk.core.errortype
.
Initialization errors
If an error occurs during initialization, the user can’t use Unblu.
Errors during initialization are returned via the InitializeExceptionCallback
callback passed to the initialization method (see Code setup and initialization^).
You should either inform user that Unblu is momentarily unavailable or ensure that the Unblu integration isn’t displayed in your app to prevent users from trying to access the Unblu UI.
Runtime errors
Most error types are returned on the callback of the method call they’re associated with. For example, if an error occurs when you try to start a mobile co-browsing session by calling UnbluConversation.startMobileCoBrowsing
, the MobileCoBrowsingExceptionCallback
contains a MobileCoBrowsingErrorType
.
Runtime errors can also be emitted with the Unblu.onError
event. The event returns an ErrorData
object containing an UnbluClientErrorType
.
How you should handle runtime errors depends on the specific error type. Most runtime errors aren’t fatal, but the following errors require you to deinitialize and reinitialize the SDK:
See also
-
For more information on the Unblu Android mobile SDK’s logging and error handling capabilities, refer to the reference documentation.
-
For general information on logging in Unblu, refer to Logging^.