Logger class

Class for instantiating logger.

WARNING! Do not use this class directly for logging.

This class provides a way to log messages, exceptions, and warnings using a set of log strategies. To use this class, you should create an instance of it with a set of log strategies, and then call the log, e, and w methods to log messages, exceptions, and warnings, respectively.

Implemented types

Constructors

Logger.empty()
Initialize logger without strategies.
Logger.withStrategies(Set<LogStrategy> _strategies)
Initialize logger with strategies.

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

addStrategy(LogStrategy strategy) → void
Add strategy to logger.
clearStrategies() → void
Remove all strategies from logger.
contains(LogStrategy strategy) bool
Check if a strategy is contained in the logger.
e(Object exception, [StackTrace? stackTrace]) → void
Logs an exception.
override
forEach(void action(LogStrategy strategy)) → void
Iterate over all strategies.
log(Object message) → void
Logs a simple message.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeStrategy(LogStrategy strategy) → void
Remove strategy from logger.
toString() String
A string representation of this object.
inherited
w(String message, [Exception? exception, StackTrace? stackTrace]) → void
Logs a warning message.
override

Operators

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