DebugLogger

interface DebugLogger(source)

Writes a diagnostic line, but only for the categories that are switched on.

message is a lambda rather than a String so that instrumenting a path taken once per chat message costs nothing while debugging is off: the interpolation never runs. The if (debugMode) logger.info("... $word") guards this replaced paid for their strings either way.

Inheritors

Types

Link copied to clipboard

A logger for callers that have no debug state to consult, such as tests of unrelated code.

Functions

Link copied to clipboard
abstract fun isEnabled(category: DebugCategory): Boolean
Link copied to clipboard
abstract fun log(category: DebugCategory, message: () -> String)