Logger

class Logger(    tag: Logger.Tag,     frontEnds: Collection<LogFrontend>,     filters: List<LogFilter> = emptyList(),     mappers: List<LogMapper> = emptyList())

Logger

Constructors

Link copied to clipboard
fun Logger(    tag: Logger.Tag,     frontEnds: Collection<LogFrontend>,     filters: List<LogFilter> = emptyList(),     mappers: List<LogMapper> = emptyList())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Entry(    val level: Logger.Level,     val ex: Throwable? = null,     val meta: Map<String, Any> = emptyMap(),     val instant: Instant = now())

Metadata that helps describe log messages

Link copied to clipboard
enum Level : Enum<Logger.Level>

Log severity

Link copied to clipboard
data class Tag(val pkg: String, val name: String)

Log entry identifier with a package and a name

Functions

Link copied to clipboard
inline fun debug(msgCreator: () -> String)

Log a message with DEBUG severity

Link copied to clipboard
inline fun error(ex: Throwable)

Log an exception with ERROR severity

inline fun error(ex: Throwable? = null, msgCreator: () -> String)

Log an exception and a message with ERROR severity

Link copied to clipboard
inline fun info(msgCreator: () -> String)

Log a message with INFO severity

Link copied to clipboard
inline fun log(    level: Logger.Level,     error: Throwable? = null,     meta: Map<String, Any> = emptyMap(),     msgCreator: () -> String? = { null })

Create a Logger.Entry with the proper metadata and pair it with a given message

Link copied to clipboard
inline fun warning(ex: Throwable)

Log an exception with WARNING severity

inline fun warning(ex: Throwable? = null, msgCreator: () -> String)

Log an exception and a message with WARNING severity