AndroidLogger

class AndroidLogger(tag: String = "CGS", val minLevel: LogLevel = LogLevel.WARN) : Logger

Default Android implementation of Logger that delegates to android.util.Log.

Logging is filtered according to a minimum severity level. Only messages with a level greater or equal to minLevel will be emitted.

This logger is intended for SDK-level diagnostics and can be replaced by SDK consumers with a custom implementation if needed (e.g. forward to Crashlytics or a proprietary logging stack).

Parameters

tag

the Android log tag used for all emitted messages (default "CGS")

minLevel

the minimum log level required to actually log a message

Levels below minLevel are silently ignored and produce no log output.

Constructors

Link copied to clipboard
constructor(tag: String = "CGS", minLevel: LogLevel = LogLevel.WARN)

Properties

Link copied to clipboard
open override val minLevel: LogLevel

Functions

Link copied to clipboard
open override fun d(message: String, t: Throwable?)

Logs at LogLevel.DEBUG: verbose detail useful while integrating.

Link copied to clipboard
open override fun e(message: String, t: Throwable?)

Logs at LogLevel.ERROR: a failure the SDK could not recover from.

Link copied to clipboard
open override fun i(message: String, t: Throwable?)

Logs at LogLevel.INFO: normal lifecycle and diagnostic events.

Link copied to clipboard
open override fun w(message: String, t: Throwable?)

Logs at LogLevel.WARN: something unexpected that the SDK recovered from.