Logger

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

Logger

Constructors

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

Types

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

Metadata that helps describe log messages

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

Log severity

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

Log entry identifier with a package and a name

Functions

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

Log a message with DEBUG severity

error
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

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

Log a message with INFO severity

log
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

warning
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