MultiLogWriter class
A LogWriter that fans out to multiple child writers.
Constructors
-
MultiLogWriter(List<
LogWriter> _writers) -
Creates a MultiLogWriter that fans out to
_writers. The list is held by reference and may be mutated via add / remove.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
LogWriter writer) → void -
Appends
writerto the chain. Useful when a writer can only be constructed after the chain has already been built (e.g. a writer that needs a database session that doesn't exist yet at startup). -
close(
) → Future< void> -
Releases any resources held by the writer.
override
-
closeScope(
LogScope scope, {required bool success, required Duration duration, Object? error, StackTrace? stackTrace}) → Future< void> -
Ends a scoped operation.
override
-
log(
LogEntry entry) → Future< void> -
Writes a single log entry.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openScope(
LogScope scope) → Future< void> -
Begins a scoped operation.
override
-
remove(
LogWriter writer) → bool -
Removes
writerfrom the chain, if present. Counterpart to add; used when the chain needs to be reconfigured after construction (e.g. swapping a console writer once config has been loaded). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited