class ConsoleLogProvider
source · line 49public
public class ConsoleLogProvider public constructor(
private val stream: ConsoleStream = ConsoleStream.Stderr,
private val minLevel: LogLevel = LogLevel.Info,
private val clock: Clock = SystemClock,
private val format: (LogRecord, Instant) -> String = ::defaultConsoleLogFormat
) : LogProvider
- Supertype
LogProvider
Synchronously writes complete UTF-8 records to a borrowed standard stream. Instances writing the same stream share a lock. The clock and formatter run outside the lock and may run concurrently.
function isEnabled
source · line 56public
public override fun isEnabled(level: LogLevel, target: String): Boolean
- Overrides
isEnabled
Enables all targets at or above the configured minimum severity.
parameter level
source · line 56public
level: LogLevel
parameter target
source · line 56public
target: String
function emit
source · line 59public
public override fun emit(record: LogRecord): Unit
- Overrides
emit
Formats an already enabled event, appends one LF, and completes the write before returning.
parameter record
source · line 59public
record: LogRecord
constructor constructor
source · line 49public
constructor(private val stream: ConsoleStream = ConsoleStream.Stderr, private val minLevel: LogLevel = LogLevel.Info, private val clock: Clock = SystemClock, private val format: (LogRecord, Instant) -> String = ::defaultConsoleLogFormat)
parameter clock
source · line 52public
private val clock: Clock = SystemClock
parameter format
source · line 53public
private val format: (LogRecord, Instant) -> String = ::defaultConsoleLogFormat
parameter minLevel
source · line 51public
private val minLevel: LogLevel = LogLevel.Info
parameter stream
source · line 50public
private val stream: ConsoleStream = ConsoleStream.Stderr
function flush
source · line 66public
public override fun flush(): Unit
- Overrides
flush
Flushes the borrowed stream under the same lock as writes; standard streams are unbuffered.