StructuredLogger class

A Logger that writes one JSON object per line to an IOSink (stderr by default), filtering records below minLevel.

Implemented types
Mixed-in types

Constructors

StructuredLogger({IOSink? sink, LogLevel minLevel = LogLevel.info, Map<String, Object?> base = const {}})
Creates a structured logger writing to sink (defaults to stderr).

Properties

hashCode int
The hash code for this object.
no setterinherited
minLevel LogLevel
The minimum level emitted; lower-severity records are dropped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sink IOSink
The sink records are written to.
final

Methods

child(Map<String, Object?> context) Logger
Returns a logger that merges context into every record it emits.
override
debug(String message, {Map<String, Object?> context = const {}}) → void
Convenience for LogLevel.debug.
inherited
error(String message, {Map<String, Object?> context = const {}}) → void
Convenience for LogLevel.error.
inherited
info(String message, {Map<String, Object?> context = const {}}) → void
Convenience for LogLevel.info.
inherited
log(LogLevel level, String message, {Map<String, Object?> context = const {}}) → void
Emits a log record at level with message and optional context.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
warn(String message, {Map<String, Object?> context = const {}}) → void
Convenience for LogLevel.warn.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited