ConsoleLogHandler class
A implementation of BDLogHandler that print BDLogRecord to the console. This class is responsible for handling log records and printing them to the console.
It supports different log levels and can format the log records before printing.
- Inheritance
-
- Object
- BDLogHandler
- ConsoleLogHandler
Constructors
-
ConsoleLogHandler.new({LinePrinter? printer, List<
BDLevel> supportedLevels = BDLevel.values, BDLogFormatter logFormatter = const DefaultLogFormatter()}) -
Create a new instance of the ConsoleLogHandler.
factory
-
ConsoleLogHandler.private(List<
BDLevel> supportedLevels, BDLogFormatter logFormatter, 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(
BDLevel level, String line) → String - This method colors a line depending on its log level.
-
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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited