Logger class

Constructors

Logger(LogSink _sink, {int level = 0})
create a Logger with LogSink

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sink LogSink
no setter

Methods

enabled() bool
tests whether this Logger is enabled.
end([Map? values]) Logger
error(dynamic err, dynamic valuesOrMsg, {StackTrace? stackTrace}) → dynamic
logs an Exception, String message or Map values as context and stackTrace if passed.
info(dynamic valuesOrMsg) → dynamic
logs a non-error String message or Map values as context.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start(String name, [Map? values]) Logger
toString() String
A string representation of this object.
inherited
v(int lvl) Logger
returns a new Logger instance for a specific verbosity level, relative to this Logger.
withName(String name) Logger
returns a new Logger instance with the specified name element added
withSink(LogSink sink) Logger
withValues(Map values) Logger
returns a new Logger instance with Map values.

Operators

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

Static Properties

current Logger?
returns a Logger from ctx or null.
no setter

Static Methods

span<T>(String name, T action(), [Map? startValues]) → T
withLogger(Logger? logger) → Context
returns a new Context, derived from ctx, which carries the provided Logger.