KaliumLogger

class KaliumLogger(config: KaliumLogger.Config = Config.DISABLED, tag: KaliumLogger.Tag = Tag.Text("KaliumLogger"))

Custom logger writer which uses multiplatform KermitLogger underneath to allow to customize log message or tag.

Parameters

config

the Config object which contains the configuration of the logger.

tag

the Tag object which identifies the source of the log message. Can combine multiple data and turns it into structured String used by the KermitLogger so that it can be parsed back again to the Tag object. To know more how it behaves and what are the possibilities, take a look at the Tag sealed class and its subtypes.

Constructors

Link copied to clipboard
constructor(config: KaliumLogger.Config = Config.DISABLED, tag: String = "KaliumLogger")
constructor(config: KaliumLogger.Config = Config.DISABLED, tag: KaliumLogger.Tag = Tag.Text("KaliumLogger"))

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Config(val initialLevel: KaliumLogLevel, val initialLogWriterList: List<<Error class: unknown class>> = listOf(platformLogWriter()))

Represents the configuration for the KaliumLogger.

Link copied to clipboard
data class LogAttributes(val userClientData: KaliumLogger.UserClientData?, val textTag: String)
Link copied to clipboard
sealed class Tag

Defined types of tags that can be provided to the KaliumLogger as a String text.

Link copied to clipboard
data class UserClientData(val userId: String, val clientId: String?)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun d(message: String, throwable: Throwable? = null, tag: String = this.tag()): <Error class: unknown class>
Link copied to clipboard
fun e(message: String, throwable: Throwable? = null, tag: String = this.tag()): <Error class: unknown class>
Link copied to clipboard
fun i(message: String, throwable: Throwable? = null, tag: String = this.tag()): <Error class: unknown class>
Link copied to clipboard
fun v(message: String, throwable: Throwable? = null, tag: String = this.tag()): <Error class: unknown class>
Link copied to clipboard
fun w(message: String, throwable: Throwable? = null, tag: String = this.tag()): <Error class: unknown class>
Link copied to clipboard

Creates a new logger with custom tag that replaces the old tag and allows to specify which specific app flow, one of ApplicationFlow, the logs sent by this logger relate to. When the logger already contains Tag.UserClientText type of logs, then user-related tag data will still be included, and this featureId tag part will be added as a prefix, to keep the standard pattern of the tag: "taguserId|clientId". In this case it will become "featureId:featureNameuserId|clientId". When current type of tag is Tag.Text, then it will just replace it with the new one: "featureId:featureName".

Link copied to clipboard
fun withTextTag(textTag: String): KaliumLogger

Creates a new logger with a custom tag that replaces the old tag.

Link copied to clipboard

Creates a new logger with custom tag that replaces the old tag and allows to add user-related data to the tag. When the logger already contains Tag.UserClientText type of tag, then user-related tag data part will be replaced, and if it contained already some text tag prefix part, then the same prefix will be also included in the new one, to keep the standard pattern of the tag: "taguserId|clientId".