Logger constructor

Logger({
  1. LogFilter? filter,
  2. LogPrinter? printer,
  3. LogOutput? output,
  4. Level? level,
})

Create a new instance of Logger.

You can provide a custom printer, filter and output. Otherwise the defaults: PrettyPrinter, DevelopmentFilter and ConsoleOutput will be used.

Implementation

Logger({
  LogFilter? filter,
  LogPrinter? printer,
  LogOutput? output,
  Level? level,
})  : _filter = filter ?? DevelopmentFilter(),
      _printer = printer ?? PrettyPrinter(),
      _output = output ?? ConsoleOutput() {
  _filter.init();
  _filter.level = level ?? Logger.level;
  _printer.init();
  _output.init();
}