Logger class
Singleton logger that writes all output to stderr.
Usage:
Logger.init(); // Call once at startup
Logger.info('Server started');
Logger.error('Something failed', error, stackTrace);
Configure via the LOG_LEVEL environment variable:
debug— verbose output for developmentinfo— default; general operational messageswarn— potential issues that are non-fatalerror— failures that need attention
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
-
debug(
String message) → void - Log a debug-level message.
-
error(
String message, [Object? error, StackTrace? stackTrace]) → void -
Log an error-level message with an optional
errorandstackTrace. -
info(
String message) → void - Log an info-level message.
-
init(
) → void -
Initialise the logger from the
LOG_LEVELenvironment variable. -
warn(
String message) → void - Log a warning-level message.