Logger constructor
const
Logger({
- String? service,
- String? defaultModule,
- LokiOptions? lokiOptions,
- LoggerOptions options = defaultLevelOptions,
- LoggerFilter? filter,
- dynamic onLog()?,
- 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,
});