DebugLogger class
Debug logger that stores log entries in memory.
Usage:
DebugLogger.log("User logged in");
DebugLogger.log("API error", level: LogLevel.error);
DebugLogger.log("Network request", tag: "Network");
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Static Methods
-
addListener(
void listener(LogEntry)) → void - Add a listener that gets called when a new log is added.
-
clear(
) → void - Clear all logs.
-
debug(
String message, {String? tag}) → void - Log a debug message.
-
error(
String message, {String? tag}) → void - Log an error message.
-
export(
) → String - Export all logs as a string.
-
exportJson(
) → String - Export all logs as JSON.
-
getLogsByLevel(
LogLevel level) → List< LogEntry> - Get logs filtered by level.
-
getLogsByTag(
String tag) → List< LogEntry> - Get logs filtered by tag.
-
info(
String message, {String? tag}) → void - Log an info message.
-
log(
String message, {LogLevel level = LogLevel.debug, String? tag}) → void - Log a message.
-
removeListener(
void listener(LogEntry)) → void - Remove a listener.
-
search(
String query) → List< LogEntry> - Search logs by message content.
-
warning(
String message, {String? tag}) → void - Log a warning message.