ConsoleLogHandler class

A implementation of BDLogHandler that print BDLogRecord to the console.

Inheritance

Constructors

ConsoleLogHandler({BDLogFormatter logFormatter = const DefaultLogFormatter(), List<BDLevel> supportedLevels = BDLevel.levels, LinePrinter? printer})
Create a new instance of the ConsoleLogHandler.
factory
ConsoleLogHandler.private(List<BDLevel> supportedLevels, BDLogFormatter logFormatter, Queue<String> _logsBuffer, Stopwatch _printPauseWatcher, RescheduleCallback _reschedulePrinting, LinePrinter _printer)
Private constructor mostly for testing purpose.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
logFormatter BDLogFormatter
BDLogFormatter that define how BDLogRecord should printed on console.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLevels List<BDLevel>
Supported BDLevel of BDLogRecord.
final

Methods

colorLine(String line) String
Colors line depending on BDLevel.
handleRecord(BDLogRecord record) Future<void>
Handle the BDLogRecord.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supportLevel(BDLevel level) bool
Allow the BDLogHandler to specify which BDLevel of BDLogRecord he can handle.
override
throttleLogPrint() → void
Implementation of print that throttles messages. This avoids dropping messages on platforms that rate-limit their logging.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

maxPrintCapacity → const int
Maximum characters length in byte that can be printed before maxPrintPause is required.
maxPrintPause → const Duration
Maximum pause time required before restarting to print logs.