SinglePrettyPrinter class

Default implementation of LogPrinter.

Output looks like this:

💡 [INFO]    06:46:15.354 demo (file:///your/file/path/roggle/example/main.dart:16:10): Log message
Inheritance
Implementers

Constructors

SinglePrettyPrinter({String? loggerName, bool colors = true, bool printCaller = true, bool printLocation = true, bool printFunctionName = true, bool printEmojis = true, bool printLabels = true, bool printTime = true, Level stackTraceLevel = Level.off, int? stackTraceMethodCount = defaultStackTraceMethodCount, String stackTracePrefix = defaultStackTracePrefix, Map<Level, AnsiColor>? levelColors, Map<Level, String> levelEmojis = defaultLevelEmojis, Map<Level, String> levelLabels = defaultLevelLabels, TimeFormatter timeFormatter = formatTime})

Properties

colors → bool
If set to true, the log will be colorful.
final
hashCode → int
The hash code for this object.
no setterinherited
levelEmojis → Map<Level, String>
Emoji for each log level.
final
levelLabels → Map<Level, String>
String for each log level.
final
loggerName → String?
If specified, it will be output at the beginning of the log.
final
printCaller → bool
If set to true, caller will be output to the log.
final
printEmojis → bool
If set to true, the emoji will be output to the log.
final
printFunctionName → bool
If set to true, function name of caller will be output to the log.
final
printLabels → bool
If set to true, the log level string will be output to the log.
final
printLocation → bool
If set to true, location of caller will be output to the log.
final
printTime → bool
If set to true, the time stamp will be output to the log.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTraceLevel → Level
The current logging level to display stack trace.
final
stackTraceMethodCount → int?
Number of stack trace methods to display.
final
stackTracePrefix → String
Stack trace prefix.
final
timeFormatter → TimeFormatter
Formats the current time.
final

Methods

convertToCallerString(Frame frame, {bool printFunctionName = true, bool printLocation = true}) → String?
destroy() → Future<void>
inherited
formatFixed({required Level level, required DateTime time}) → String
getCaller({StackTrace? stackTrace}) → String?
getLevelColor(Level level) → AnsiColor
getStackTrace({StackTrace? stackTrace}) → List<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
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

defaultLevelColors → Map<Level, AnsiColor>
Color default for each log level.
final

Static Methods

formatTime(DateTime now) → String

Constants

defaultLevelEmojis → const Map<Level, String>
Emoji default for each log level.
defaultLevelLabels → const Map<Level, String>
String default for each log level.
defaultStackTraceMethodCount → const int
Stack trace method count default.
defaultStackTracePrefix → const String
Stack trace prefix default.