ConsoleTransport class

Console-based log transport with colorized, human-readable output.

Respects app.debug config — silently drops logs in production.

Supports:

  • ANSI colors
  • Pretty or JSON formatting
  • Timestamp + level + message + context + metadata
Implemented types

Constructors

ConsoleTransport({bool useColors = true, bool formatJson = false})
Creates a console transport.

Properties

formatJson bool
Outputs logs as indented JSON instead of formatted string.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useColors bool
Enables ANSI color codes in output.
final

Methods

dispose() Future<void>
Cleans up resources (close files, flush buffers, etc.).
override
log(LogEntry entry) Future<void>
Logs a single entry.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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