copyWith method

Logger copyWith({
  1. String? service,
  2. String? defaultModule,
  3. LoggerOptions? options,
  4. LokiOptions? lokiOptions,
  5. LoggerFilter? filter,
})

Creates a copy of the current logger with the given parameters.

  • service: The name of the service using the logger.
  • defaultModule: The default module name for the logger.
  • options: Options for configuring the logger.
  • lokiOptions: Configuration options for Loki.
  • filter: A filter that determines whether a log of a particular level should be printed or pushed.

Implementation

Logger copyWith({
  String? service,
  String? defaultModule,
  LoggerOptions? options,
  LokiOptions? lokiOptions,
  LoggerFilter? filter,
}) =>
    Logger(
      service: service ?? this.service,
      defaultModule: defaultModule ?? this.defaultModule,
      options: options ?? this.options,
      lokiOptions: lokiOptions ?? this.lokiOptions,
      filter: filter ?? this.filter,
    );