DefaultMosaicLogger

class DefaultMosaicLogger(level: Level = Level.INFO) : MosaicLogger

The MosaicLogger MosaicDependencyInjectionConfig.logger defaults to when an app doesn't supply its own — just println("$level: $msg"), no filtering beyond MosaicLogger's own level cutoff, no crash reporting, no remote sink. Meant for development; a real app typically supplies its own MosaicLogger wired to whatever telemetry/crash-reporting tool it already uses.

Constructors

Link copied to clipboard
constructor(level: Level = Level.INFO)

Properties

Link copied to clipboard

the minimum severity this logger actually emits — anything below it is silently dropped by isAt/log, never reaching display at all.

Functions

Link copied to clipboard
fun debug(msg: String)

Logs msg at Level.DEBUG.

Link copied to clipboard
open override fun display(level: Level, msg: String)

Emits one already-filtered log line. Implement this to route to println, a crash reporter, a remote log sink, etc. — never called directly by framework code; always through log.

Link copied to clipboard
fun error(msg: String)

Logs msg at Level.ERROR.

Link copied to clipboard
fun info(msg: String)

Logs msg at Level.INFO.

Link copied to clipboard
fun isAt(lvl: Level): Boolean

Whether lvl would actually be emitted by this logger, given its own level.

Link copied to clipboard
inline fun log(lvl: Level, msg: () -> String)

Same as log, but msg is only evaluated if lvl would actually be emitted — use this overload when building the message string itself is non-trivial work (e.g. serializing a payload), to avoid paying that cost on a level the logger would discard anyway.

fun log(lvl: Level, msg: String)

Logs msg at lvl, only calling display if isAt returns true for lvl.

Link copied to clipboard
fun warn(msg: String)