MessageLogPrinter class

An extension of PrettyPrinter that displays the content of a MessageLog and prevents long texts from being truncated.

Output looks like this:

─ID────────────────────────
 Identifier
─Time──────────────────────
 Time
─Error─────────────────────
 Error info
─Stacktrace────────────────
 Method stack history
─Message───────────────────
 Message
─Data──────────────────────
 Data
──────────────────────────–
Inheritance

Constructors

MessageLogPrinter({int stackTraceBeginIndex = 0, int? methodCount = 2, int? errorMethodCount = 8, int lineLength = 120, bool colors = true, bool printEmojis = true, bool printTime = true, Map<Level, bool> excludeBox = const {}, bool noBoxingByDefault = false, List<RegExp>? stackTraceBlocklist})
An extension of PrettyPrinter that displays the content of a MessageLog and prevents long texts from being truncated.

Properties

colors bool
Whether ansi colors are used to color the output.
finalinherited
errorMethodCount int?
Controls the method count in stack traces when LogEvent.error was provided.
finalinherited
excludeBox Map<Level, bool>
Controls the ascii 'boxing' of different Levels.
finalinherited
excludePaths List<String>
A list of custom paths that are excluded from the stack trace.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
levelColors Map<Level, AnsiColor>?
Controls the colors used for the different log levels.
finalinherited
levelEmojis Map<Level, String>?
Controls the emojis used for the different log levels.
finalinherited
lineLength int
Controls the length of the divider lines.
finalinherited
methodCount int?
Controls the method count in stack traces when no LogEvent.error was provided.
finalinherited
noBoxingByDefault bool
Whether the implicit bools in excludeBox are true or false by default.
finalinherited
printEmojis bool
Whether emojis are prefixed to the log line.
finalinherited
printTime bool
Whether LogEvent.time is printed.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTraceBeginIndex int
The index at which the stack trace should start.
finalinherited
stackTraceBlocklist List<RegExp>
A collection of regex for excluding stack trace lines from being shown in the output.
final

Methods

copyWith({int? stackTraceBeginIndex, int? methodCount, int? errorMethodCount, int? lineLength, bool? colors, bool? printEmojis, bool? printTime, Map<Level, bool>? excludeBox, bool? noBoxingByDefault, List<RegExp>? stackTraceBlocklist}) MessageLogPrinter
Creates a new MessageLogPrinter with the values replaced by the non-null.
destroy() Future<void>
inherited
formatStackTrace(StackTrace? stackTrace, int? methodCount) String?
override
getTime(DateTime time) String
A replacement for PrettyPrinter.getTime.
override
init() Future<void>
inherited
log(LogEvent event) List<String>
Is called every time a new LogEvent is sent and handles printing or storing the message.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stringifyMessage(dynamic message) String
inherited
toEncodableFallback(dynamic object) Object
inherited
toString() String
A string representation of this object.
inherited

Operators

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