ConsoleSink constructor

ConsoleSink({
  1. LogLevel minLevel = LogLevel.trace,
  2. bool? color,
  3. int stackFrames = 8,
  4. void write(
    1. String line
    )?,
})

Creates a console sink. Set color explicitly for tests or non-tty writers; otherwise it's auto-detected from stdout.supportsAnsiEscapes. stackFrames caps how many stack lines are printed per record.

Implementation

ConsoleSink({
  this._minLevel = LogLevel.trace,
  bool? color,
  this.stackFrames = 8,
  void Function(String line)? write,
}) : _color = color ?? _detectAnsi(),
     _write = write ?? _defaultConsoleWrite;