MockLogger class
Mock implementation of Logger for testing
Constructors
Properties
-
debugLogs
→ List<
LogEntry> -
Get debug logs
no setter
-
errorLogs
→ List<
LogEntry> -
Get error logs
no setter
- hasErrors → bool
-
Check if any errors were logged
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasWarnings → bool
-
Check if any warnings were logged
no setter
-
infoLogs
→ List<
LogEntry> -
Get info logs
no setter
- lastLog → LogEntry?
-
Get the last log entry
no setter
-
logs
→ List<
LogEntry> -
List of all logged messages
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
warningLogs
→ List<
LogEntry> -
Get warning logs
no setter
Methods
-
clear(
) → void - Clear all logs
-
debug(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at debug level
-
error(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at error level
-
fatal(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at fatal level
-
getLogsByLevel(
LoggingLogLevel level) → List< LogEntry> - Get logs by level
-
info(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at info level
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verbose(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at verbose level
-
warn(
dynamic message, {dynamic exception, String? information, Map< String, dynamic> ? metadata}) → void - Log at warning level
-
wasMessageLogged(
String message) → bool - Check if a message was logged
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited