ConsoleTransport class

Transport for console (stdout) output.

config keys:

  • format (String): log line template; supports {level}, {message}, {timestamp}, {error}, {stackTrace}, {context}.
  • colorize (bool): wrap output in ANSI colors (default true).
Inheritance
Available extensions

Constructors

ConsoleTransport({LogLevel level = LogLevel.info, Map<String, dynamic> config = const {}})
Creates a ConsoleTransport.

Properties

colorize bool
Whether to wrap output in ANSI colors. Defaults to true.
final
config Map<String, dynamic>
Arbitrary key/value options passed to the transport at construction time.
finalinherited
format String
Log line template. Supports {level}, {message}, {timestamp}, {error}, {stackTrace}, {context} placeholders.
final
hashCode int
The hash code for this object.
no setterinherited
level LogLevel
Minimum severity level this transport will handle.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

emitLog(LogEvent event) Future<void>
Performs the actual delivery of event to the transport's destination.
override
log(LogEvent event) Future<void>
Delivers event to the destination if event.level >= this.level.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withBuffer({int maxSize = 100, Duration? flushInterval}) BufferedTransport

Available on Transport, provided by the BufferedTransportExtension extension

Wraps this transport in a BufferedTransport.
withSampling({required double sampleRate, List<LogLevel> levels = const [], Random? random}) SamplingTransport

Available on Transport, provided by the SamplingTransportExtension extension

Wraps this transport in a SamplingTransport.

Operators

operator ==(Object other) bool
The equality operator.
inherited