Log class
Facade for application logging.
Use Log.debug/info/warning/error to emit structured logs via the
framework logger. Call Log.channel('name') to obtain a channel-specific
logger.
Example:
Log.info('User logged in', context: {'id': 1});
Log.channel('audit').warning('Unauthorized access');
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 Methods
-
channel(
String name) → ChannelLogger - Creates a logger proxy for a specific channel.
-
critical(
String message, {Map< String, dynamic> ? context, StackTrace? stackTrace, String? channel}) → void - Logs a critical message.
-
debug(
String message, {Map< String, dynamic> ? context, StackTrace? stackTrace, String? channel}) → void - Logs a debug message.
-
error(
String message, {Map< String, dynamic> ? context, StackTrace? stackTrace, String? channel}) → void - Logs an error message.
-
info(
String message, {Map< String, dynamic> ? context, StackTrace? stackTrace, String? channel}) → void - Logs an info message.
-
time(
String label) → void - Starts a timer with the given label.
-
timeEnd(
String label, {LogLevel level = LogLevel.debug}) → void - Stops the timer with the given label and logs the elapsed time.
-
warning(
String message, {Map< String, dynamic> ? context, StackTrace? stackTrace, String? channel}) → void - Logs a warning message.