ZenithLogger class
A structured logging engine with automatic PII redaction and extensible sinks.
Equivalent to Serilog in .NET.
final logger = ZenithLogger(sinks: [ConsoleSink(), MemoryRingBufferSink()]);
logger.info('User {userId} logged in', {'userId': '123'});
Constructors
-
ZenithLogger({List<
ZenithLogSink> ? sinks}) -
Creates a ZenithLogger with the given
sinks.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sinks
→ List<
ZenithLogSink> -
List of active sinks receiving log events.
final
Methods
-
error(
String template, [Map< String, dynamic> ? properties, Object? error, StackTrace? stackTrace]) → void - Logs an error message.
-
info(
String template, [Map< String, dynamic> ? properties, Object? error, StackTrace? stackTrace]) → void - Logs an informational message.
-
log(
ZenithLogLevel level, String template, [Map< String, dynamic> ? properties, Object? error, StackTrace? stackTrace]) → void - Core log emission method. Applies PII redaction to properties and broadcasts to sinks.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
warning(
String template, [Map< String, dynamic> ? properties, Object? error, StackTrace? stackTrace]) → void - Logs a warning message.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited