Skip to content

IOMb Lib Android - Debug Information

For the purpose of general error analysis and esp. the sending of measurement data the IOMb Lib Android can be set into a debug mode.

In this debug mode the IOMb Lib Android generates outputs in the log stream (console): errors, warnings, info, events and requests.

These outputs can then be conveniently filtered in the console.

To enable debug mode, the debugMode flag of the IOLDebug singleton object is set to true:

1
2
3
4
5
6
class App : Application() {

    override fun onCreate() {
        super.onCreate()

        IOLDebug.debugMode = true

By default, debug mode is disabled.

note

Please disable debug mode before publishing the app.


Logs can be intercepted and routed to arbitrary channels using a callback to be set to IOLDebug.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
IOLDebug.logListener = object : LogListener {
    override fun onLog(
        priority: Int,
        tag: String,
        message: String?,
        throwable: Throwable?
    ) {
        if(priority >= Log.DEBUG) {
            // e.g. push to external log system
        }
      }
    }

Last update: May 10, 2023