TheLogger class

The Logger: modularity, extensibility, testability

Constructors

TheLogger.i()
Get logger instance
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
minLevel → Level
Get computed minimal level
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<MaskedLogRecord>
A broadcast stream of masked log records.
no setter

Methods

addMaskingString(MaskingString maskingString) → void
Add masking string
addMaskingStrings(MaskingStrings maskingStrings) → void
Add masking strings
clearAllLogs() Future<void>
Clear logs (for debug purposes only)
clearMaskingStrings() → void
Clear masking strings
dispose() Future<void>
Dispose logger
getAllLogs() Future<List<LogRecord>>
Get all logs as LogRecords (for debug purposes only)
getAllLogsAsMaps() Future<List<Map<String, Object?>>>
Get all logs as maps (for debug purposes only)
getAllLogsAsString() Future<String>
Get all logs as strings (for debug purposes only)
init({Map<Level, int> retainStrategy = const {}, bool startNewSession = true, bool consoleLogger = true, bool dbLogger = true, bool maskDbLogger = true, ConsoleLoggerCallback? consoleLoggerCallback, ConsoleColors consoleColors = const ConsoleColors(), bool consoleFormatJson = true, String? sessionStartExtra, List<AbstractLogger>? customLoggers, Level sessionStartLevel = Level.INFO, LoggerDatabase? database}) Future<void>
Init app logger
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMaskingString(MaskingString maskingString) → void
Remove masking string
removeMaskingStrings(MaskingStrings maskingStrings) → void
Remove masking strings
startSession() Future<void>
Increment session id
toString() String
A string representation of this object.
inherited
writeAllLogsToJson([String filename = 'logs.json']) Future<String>
Write logs to archived JSON, return file path

Operators

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