Logger class Utilities
A utility class for conditional logging with environment-controlled tracing.
The Logger class provides static methods to emit log messages to
stderr
based on a runtime environment variable.
Logging is only enabled when the PIXEL_PROMPT_TRACING
environment
variable is set to '1'
.
Output is written to stderr
with a structured format that includes:
- A log level prefix (e.g., TRACE, DEBUG, INFO)
- An ISO 8601 timestamp
- A user-defined tag
- The message content
This is especially useful for separating debug logs from golden file output or other stdout-driven content.
Example usage:
Logger.debug('RenderPipeline', 'Component rendered');
No logs are written if tracing is disabled.
Constructors
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
-
debug(
String tag, String msg) → void -
Emits a debug-level log with the given
tag
andmsg
. -
error(
String tag, String msg) → void -
Emits an error-level log with the given
tag
andmsg
. -
info(
String tag, String msg) → void -
Emits an info-level log with the given
tag
andmsg
. -
trace(
String tag, String msg) → void -
Emits a trace-level log with the given
tag
andmsg
. -
warn(
String tag, String msg) → void -
Emits a warning-level log with the given
tag
andmsg
.