MosaicLogger

abstract class MosaicLogger(val level: Level = Level.INFO)

Logging abstraction every part of mosaic-client writes through — EventRunningScope.log/ logError, BuilderScope.log/logError, and every EventRunner's own error handling all eventually call into a MosaicLogger. Replaced app-wide via MosaicDependencyInjectionConfig.logger (defaults to DefaultMosaicLogger) — an app wiring its own crash-reporting/telemetry sink implements this once, and every log call in the framework (built-in or custom) routes through it automatically, with no per-call-site change needed.

Inheritors

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
abstract 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)