ComposablePrinter class

A LogPrinter that formats records through a composable decorator pipeline.

Construction

decorators are applied to a fresh LogStyle at construction time. The resulting style is immutable for the lifetime of the printer — mutation after construction is not supported.

Pipeline

LogEntry
  → ContentExtractor.extract()   (parse sections, className, methodName)
  → StyleResolver.resolve*()     (map LogStyle flags → ResolvedStyle)
  → LogRenderer.render()         (assemble lines)

Output

output defaults to print and can be overridden for testing.

Implemented types

Constructors

ComposablePrinter(List<LogDecorator> decorators, {int methodCount = defaultMethodCount, int? errorMethodCount, List<String> excludePaths = const [], bool showAsyncGaps = false, bool? suppressTypeNames, LogOutput output = print})
Tuning for the extraction stage:

Properties

decorators → List<LogDecorator>
The decorators applied at construction to build style.
final
hashCode → int
The hash code for this object.
no setterinherited
output → LogOutput
Sink for formatted lines. Defaults to print.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style ↔ LogStyle
The merged LogStyle produced by applying all decorators.
latefinal

Methods

dispose() → void
Releases any resources held by this printer (timers, file handles, network sockets, etc.).
override
format(LogEntry entry) → List<String>
Formats entry into a flat list of output lines without emitting them.
log(LogEntry entry) → void
Emits entry to this printer's destination.
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

Constants

defaultMethodCount → const int
Default number of stack-trace frames rendered for a non-error log.