Debugging
Using Android Studio debugger
With the integration.aar, you can use breakpoints and view variable values in Android Studio debugger. You cannot place breakpoints within the library code itself.
Logging levels
The code within the SDK outputs text logs that can be viewed through the logcat window of Android Studio or using the logcat ADB command line. You can control the verbosity of most of the SDK log outputs through the OTVLog.setLogLevel(int logLevel)
static method. The available levels are:
LOG_LEVEL_INFO
(1)LOG_LEVEL_DEBUG
(2)LOG_LEVEL_VERBOSE
(3)
For example, OTVLog.setLogLevel(OTVLog.LOG_LEVEL_INFO);
will enable LOG_LEVEL_INFO
messages but not LOG_LEVEL_DEBUG
or LOG_LEVEL_VERBOSE
.
The default debug levels set are LOG_LEVEL_INFO
for the production.aar, and LOG_LEVEL_VERBOSE
for the integration.aar.
Capturing the logs
You can capture the output logs into a log file for later analysis. Using the Android Debug Bridge (ADB) and its internal logcat command, capture the records into a file from the terminal's command-line (cmd in Windows, Terminal on a Mac). When raising a ticket with NAGRA, you may be requested to provide a log capture. In such cases you would be asked to:
- Capture logs from before the application is launched until it is terminated.
- Have log verbosity set to
LOG_LEVEL_VERBOSE
(3) Configure the log capture to include timestamps; for example:
BASHadb -d logcat -v threadtime > \path\to\logfile.log