Logger class

Use instances of logger to send log messages to the LogPrinter.

Constructors

Logger({LogFilter? filter, LogPrinter? printer, LogOutput? output, Level? level})
Create a new instance of Logger.

Properties

hashCode int
The hash code for this object.
no setterinherited
init Future<void>
Future indicating if the initialization of the logger components (filter, printer and output) has been finished.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the logger and releases all resources.
d(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.debug.
e(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.error.
f(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.fatal.
i(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.info.
isClosed() bool
log(Level level, dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message with level.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
t(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.trace.
toString() String
A string representation of this object.
inherited
v(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.verbose.
w(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.warning.
wtf(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace}) → void
Log a message at level Level.wtf.

Operators

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

Static Properties

defaultFilter LogFilter Function()
The current default implementation of log filter.
getter/setter pair
defaultOutput LogOutput Function()
The current default implementation of log output.
getter/setter pair
defaultPrinter LogPrinter Function()
The current default implementation of log printer.
getter/setter pair
level Level
The current logging level of the app.
getter/setter pair

Static Methods

addLogListener(LogCallback callback) → void
Register a LogCallback which is called for each new LogEvent.
addOutputListener(OutputCallback callback) → void
Register an OutputCallback which is called for each new OutputEvent.
removeLogListener(LogCallback callback) bool
Removes a LogCallback which was previously registered.
removeOutputListener(OutputCallback callback) → void
Removes a OutputCallback which was previously registered.