PrettyPrinter class
Default implementation of LogPrinter.
Output looks like this:
┌──────────────────────────
│ Error info
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ Method stack history
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ Log message
└──────────────────────────
- Inheritance
-
- Object
- LogPrinter
- PrettyPrinter
Constructors
-
PrettyPrinter({int stackTraceBeginIndex = 0, int? methodCount = 2, int? errorMethodCount = 8, int lineLength = 120, bool colors = true, bool printEmojis = true, @Deprecated("Use `dateTimeFormat` with `DateTimeFormat.onlyTimeAndSinceStart` or `DateTimeFormat.none` instead.") bool? printTime, DateTimeFormatter dateTimeFormat = DateTimeFormat.none, Map<
Level, bool> excludeBox = const {}, bool noBoxingByDefault = false, List<String> excludePaths = const [], Map<Level, AnsiColor> ? levelColors, Map<Level, String> ? levelEmojis})
Properties
- colors → bool
-
Whether ansi colors are used to color the output.
final
- dateTimeFormat → DateTimeFormatter
-
Controls the format of LogEvent.time.
final
- errorMethodCount → int?
-
Controls the method count in stack traces
when LogEvent.error was provided.
final
-
excludeBox
→ Map<
Level, bool> -
Controls the ascii 'boxing' of different Levels.
final
-
excludePaths
→ List<
String> -
A list of custom paths that are excluded from the stack trace.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
levelColors
→ Map<
Level, AnsiColor> ? -
Controls the colors used for the different log levels.
final
-
levelEmojis
→ Map<
Level, String> ? -
Controls the emojis used for the different log levels.
final
- lineLength → int
-
Controls the length of the divider lines.
final
- methodCount → int?
-
Controls the method count in stack traces
when no LogEvent.error was provided.
final
- noBoxingByDefault → bool
-
Whether the implicit
bool
s in excludeBox aretrue
orfalse
by default.final - printEmojis → bool
-
Whether emojis are prefixed to the log line.
final
- printTime → bool
-
Whether LogEvent.time is printed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTraceBeginIndex → int
-
The index at which the stack trace should start.
final
Methods
-
destroy(
) → Future< void> -
inherited
-
formatStackTrace(
StackTrace? stackTrace, int? methodCount) → String? -
getTime(
DateTime time) → String -
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 -
toEncodableFallback(
dynamic object) → Object -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
defaultLevelColors
→ Map<
Level, AnsiColor> -
final
-
defaultLevelEmojis
→ Map<
Level, String> -
final
- startTime ↔ DateTime?
-
getter/setter pair
Constants
- bottomLeftCorner → const String
- doubleDivider → const String
- middleCorner → const String
- singleDivider → const String
- topLeftCorner → const String
- verticalLine → const String