LoggingManager class
A manager that manages the Logger instances (provided as logger).
By default, the loggingManager
does not have a log printing or further processing mechanism. For that, you have to listen to logs from a logger.
This manager provides a LoggingTree which can do further processing by listening to logs from a logger.
A LoggingTree is responsible for doing something with logs. If none provided, nothing will happen.
The logger that is used from this manager is attached to a logging tree. You don't have to get the logger from this instance, you can just use the logger's name as every logger created with a name will return the same actual instance whenever it is called with the same string name.
Records recieved from this logger and its childrens are sent to the logging tree for further processing (or just printing, attached logging tree is responsible for processing).
Constructors
- LoggingManager({Logger? logger, LoggingTree? tree})
-
Creates a new LoggingManager with the given LoggingTree listening, & then
processing logs from the
logger
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasTree → bool
-
no setter
- logger → Logger
-
A logger that is used with the logging tree attached in this manager.
Records recieved from this logger and its childrens are sent to the
logging tree for further processing (or just printing, attached logging tree
is responsible for processing).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addLogRecord(
LogRecord record) → void -
dispose(
) → void -
getLogger(
String name) → Logger -
listenErrorsInIsolate(
Isolate context) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onRecordError(
Object? error, StackTrace? stackTrace, {String? reason, bool fatal = false}) → Future< void> - Sends a log to the current logger managed by this manager.
-
plantTree(
LoggingTree tree) → void - Attach a logging mechanism.
-
removeTree(
) → void - De-attach a logging mechanism.
-
runZoneGuardedWithLogging(
FutureCallback onRun, {void onError(Object, StackTrace)?, Map< Object?, Object?> ? zoneValues, ZoneSpecification? zoneSpecification}) → Future<void> ? - This can be used to catch errors in a zone. ometimes, errors are instead caught by Zones. A common case where relying on Flutter to catch errors would not be enough is when an exception happens inside the onPressed handler of a button.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited