LoggerTheme class
A collection of properties used by Trace in order to format the log messages.
-
A map of
AnsiColor
for each LogLevel. -
The format that will be used to print the timestamp of the log entry.
Defaults to
H:i:s.vu
.Accepts the following standard notations:
d
: Day of month (01 - 31)///j
: Day of month, without leading 0s (1 - 31)D
: An abbreviated textual representation of a day (Mon - Sun)l
: A textual representation of a day (Monday - Sunday)S
: Suffix of a day (st, th, nd)z
: The day of the year (starting from 0)F
: A textual representation of a month (January - December)M
: An abbreviated textual representation of a month (Jan - Dec)m
: Numeric representation of a month (01 - 12)n
: Numeric representation of a month, without leading 0s (1 - 12)Y
: Full numeric representation of a year (e.g. 2019)y
: A two digit representation of a year (e.g. 19)a
: Ante meridiem and post meridiem, lowercase (am or pm)A
: Ante meridiem and post meridiem, uppercase (AM or PM)g
: 12-hour format of an hour, without leading 0s (1 - 12)h
: 12-hour format of an hour (01 - 12)G
: 24-hour format of an hour, without leading 0s (0 - 23)H
: 24-hour format of an hour (00 - 23)i
: Minutes (0 - 59)s
: Seconds (0 - 59)v
: Milliseconds (0 - 999)u
: Microseconds (0 - 999)e
: System time zone identifier (Returns DateTime.timeZoneName, which is provided by the operating system and may be a name or abbreviation.)O
: Difference to Greenwich Time (GMT) in hours (±0000)P
: Difference to Greenwich Time (GMT) in hours with a colon (±00:00)T
: Time zone abbreviation (Identifies the time zone from DateTime.timeZoneName.)c
: ISO 8601 date (e.g. 2019-10-15T19:42:05-08:00)r
: RFC 2822 date (Tue, 15 Oct 2019 17:42:05 -0800)U
: Seconds since Unix Epoch\
: Escape character
-
Defines the amount of spaces that will be used to indent the stacktrace.
Defaults to 4.
-
Defines which LogSection will be printed and in what order.
Defaults to
LogSection.timestamp, LogSection.level, LogSection.message
-
timestampTheme
The
AnsiTextTheme
that will be used to print the timestamp of the log entry. -
timestampFormatter
The LogSectionFormatter that will be used to format the timestamp of the log entry.
-
levelTheme
The
AnsiTextTheme
that will be used to print the level of the log entry. -
levelFormatter
The LogSectionFormatter that will be used to format the level of the log entry.
-
messageTheme
The
AnsiTextTheme
that will be used to print the message of the log entry. -
messageFormatter
The LogSectionFormatter that will be used to format the message of the log entry.
Constructors
-
LoggerTheme.new({Map<
LogLevel, AnsiColor> colorMap = const <LogLevel, AnsiColor>{}, String timestampFormat = r'H:i:s.vu', int stacktraceIndent = 4, List<LogSection> sections = const <LogSection>[LogSection.timestamp, LogSection.level, LogSection.message], AnsiTextTheme? timestampTheme, LogSectionFormatter? timestampFormatter, AnsiTextTheme? levelTheme, LogSectionFormatter? levelFormatter, AnsiTextTheme? messageTheme, LogSectionFormatter? messageFormatter, bool? showError, bool? showStackTrace})
Properties
-
colorMap
→ Map<
LogLevel, AnsiColor> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sections
→ List<
LogSection> -
Defines the order of the log entry sections.
final
-
sectionThemeMap
→ Map<
LogSection, LogSectionTheme> -
no setter
- stacktraceIndent → int
-
final
- timestampFormat → String
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
defaultColorMap
→ Map<
LogLevel, AnsiColor> -
final