Logger constructor

const Logger({
  1. String? service,
  2. String? defaultModule,
  3. LokiOptions? lokiOptions,
  4. LoggerOptions options = defaultLevelOptions,
  5. LoggerFilter? filter,
  6. dynamic onLog(
    1. OnLogParams
    )?,
  7. PrinterFn printerFn = defaultLoggerPrinter,
})

Creates a new Logger instance.

  • service: The name of the service using the logger.
  • defaultModule: The default module name for the logger.
  • lokiOptions: Configuration options for Loki.
  • options: Options for configuring the logger, including styles for each log level and whether to enable ANSI.
  • filter: A filter that determines whether a log of a particular level should be printed or pushed.
  • onLog: A callback function that is called when a log message is created.
  • printerFn: A function to print the log messages.

Implementation

const Logger({
  this.service,
  this.defaultModule,
  this.lokiOptions,
  this.options = defaultLevelOptions,
  this.filter,
  this.onLog,
  this.printerFn = defaultLoggerPrinter,
});