WithDefaults

abstract class WithDefaults(nameNormalizer: NameNormalizer = defaultNameNormalizer) : Logbook(source)

Convenience class that provides a lot of useful features that most logbooks will want. You can override anything you don't like, of course.

Features

Four preconfigured LogLevels

  • debug – cyan text, no background

  • info – green text, no background

  • warning – yellow text, no background

  • error – white text, bright red background

The minimumLevel is set to info.

There is a default format set

[DD.MM.YYYY@hh:mm:ss.fff] LogbookName : LogLevelName – data

LogbookName has a randomly assigned color per logbook. This helps to distinguish logbooks from one another. LogLevelName has a specific color per log level, as specified above.

An AnsiConsoleOutlet is preconfigured for the whole logbook.

Constructors

Link copied to clipboard
constructor(nameNormalizer: NameNormalizer = defaultNameNormalizer)

Properties

Link copied to clipboard
open override var colorInfo: ColorInfo?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var formatter: (LogEntry) -> Iterable<Chunk>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val name: String
Link copied to clipboard
open override var outlets: MutableSet<LogOutlet>
Link copied to clipboard

Functions

Link copied to clipboard
open override fun format(entry: LogEntry): List<Chunk>
Link copied to clipboard
open fun formatWith(formatter: (LogEntry) -> Iterable<Chunk>)
Link copied to clipboard
open fun toChunk(): Chunk