DatumLogger class

Enhanced logger for the Datum package with structured logging and performance optimizations.

Constructors

DatumLogger({bool enabled = true, bool colors = true, LogLevel minimumLevel = LogLevel.info, Map<String, LogSampler> samplers = const {}, bool enablePerformanceLogging = false, Duration performanceThreshold = const Duration(milliseconds: 100)})

Properties

colors bool
final
enabled bool
final
enablePerformanceLogging bool
final
hashCode int
The hash code for this object.
no setterinherited
minimumLevel LogLevel
final
performanceThreshold Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
samplers Map<String, LogSampler>
final

Methods

copyWith({bool? enabled, bool? colors, LogLevel? minimumLevel, Map<String, LogSampler>? samplers, bool? enablePerformanceLogging, Duration? performanceThreshold}) DatumLogger
debug(String message, {String? category, Map<String, dynamic>? metadata}) → void
Convenience method for debug level logging.
error(String message, [StackTrace? stackTrace]) → void
Convenience method for error level logging.
info(String message, {String? category, Map<String, dynamic>? metadata}) → void
Convenience method for info level logging.
log(LogEntry entry) → void
Logs a structured entry with the specified level.
logPerformance({required String operation, required Duration duration, Map<String, dynamic>? metadata, String? operationId}) → void
Logs a performance operation with timing.
logSync({required LogLevel level, required String message, required String userId, String? entityId, int? itemCount, Map<String, dynamic>? metadata}) → void
Logs sync-related operations with structured metadata.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
trace(String message, {String? category, Map<String, dynamic>? metadata}) → void
Convenience method for trace level logging.
warn(String message, {String? category, Map<String, dynamic>? metadata}) → void
Convenience method for warning level logging.

Operators

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