Extra log messages will not longer be added to the log stream if more than one LoggingInterface is registered

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2025-04-29 12:57:21 +02:00
parent cb224560dc
commit 9f1b26e097
+8 -12
View File
@@ -180,10 +180,6 @@ class ArcaneLogger {
/// impact performance. /// impact performance.
bool skipAutodetection = false, bool skipAutodetection = false,
}) { }) {
if (!I._initialized) {
throw Exception("ArcaneLogger has not yet been initialized.");
}
metadata ??= <String, String>{}; metadata ??= <String, String>{};
metadata.putIfAbsent("timestamp", () => DateTime.now().toIso8601String()); metadata.putIfAbsent("timestamp", () => DateTime.now().toIso8601String());
@@ -251,15 +247,15 @@ class ArcaneLogger {
stackTrace: stackTrace, stackTrace: stackTrace,
extra: extra, extra: extra,
); );
_logStreamController.add(
"$message ${{
"level": level,
"metadata": metadata,
"extra": extra,
}}",
);
} }
_logStreamController.add(
"$message ${{
"level": level,
"metadata": metadata,
"extra": extra,
}}",
);
} }
/// Registers a [LoggingInterface] with the [ArcaneLogger]. /// Registers a [LoggingInterface] with the [ArcaneLogger].