DefaultLogger class
The toolkit's built-in LoggerInterface implementation: an in-memory, capped log buffer feeding the Logs tab.
- Implemented types
Constructors
- DefaultLogger({int? maxEntries})
-
maxEntriescaps how many entries are retained in memory. When it is omitted the cap is taken fromDevToolkitConfig.maxLogEntriesatFlutterDevToolkit.inittime; passing it explicitly always wins.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
logEntries
→ List<
LogEntry> -
All retained entries, oldest first.
no setteroverride
- maxEntries → int
-
The current retention cap.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void -
Discards every retained entry.
override
-
configure(
{required int maxEntries}) → void -
Called by
FlutterDevToolkit.initto applyDevToolkitConfig.maxLogEntries. A cap passed to the constructor takes precedence, so a consumer who configured the logger directly keeps it. -
log(
String message, {LogLevel level = LogLevel.debug, Set< LogTag> tags = const {}}) → void -
Appends a log entry, trimming the oldest one if maxEntries is now
exceeded.
override
-
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
-
errorCount
→ ValueNotifier<
int> -
Incremented each time an error-level entry is added. Never decremented,
so the FAB badge always reflects the total error count for the session.
final
-
logVersion
→ ValueNotifier<
int> -
final
Constants
- defaultMaxEntries → const int
- Retention cap used when neither the constructor nor the config sets one.