Logger

actual object Logger

Android actual implementation of Logger.

Delegates to timber.log.Timber. Timber must be planted in your Application.onCreate before the SDK is used — e.g. Timber.plant(Timber.DebugTree()).

expect object Logger

Platform-agnostic logging abstraction for the MTN MOMO SDK.

Use this in commonMain code instead of importing platform-specific logging libraries. Each platform supplies its own actual implementation:

  • Android (androidMain): delegates to timber.log.Timber, which must be planted in your Application.onCreate (e.g. Timber.plant(Timber.DebugTree())).

  • JVM (jvmMain): writes to standard output in the format {LEVEL}/{tag}: {message}.

Usage in commonMain:

Logger.d("MyClass", "debug message")
Logger.i("MyClass", "info message")
Logger.w("MyClass", "warning message")
Logger.e("MyClass", "error message", throwable)
actual object Logger

JVM actual implementation of Logger.

Writes to standard output in the format {LEVEL}/{tag}: {message}. For error logs, any supplied Throwable stack trace is printed via Throwable.printStackTrace.

Functions

Link copied to clipboard
actual fun d(tag: String, message: String)
expect fun d(tag: String, message: String)

Logs a debug-level message.

actual fun d(tag: String, message: String)
Link copied to clipboard
actual fun e(tag: String, message: String, throwable: Throwable?)
expect fun e(tag: String, message: String, throwable: Throwable? = null)

Logs an error-level message.

actual fun e(tag: String, message: String, throwable: Throwable?)
Link copied to clipboard
actual fun i(tag: String, message: String)
expect fun i(tag: String, message: String)

Logs an info-level message.

actual fun i(tag: String, message: String)
Link copied to clipboard
actual fun w(tag: String, message: String)
expect fun w(tag: String, message: String)

Logs a warning-level message.

actual fun w(tag: String, message: String)