From 6fb304a4a119284d088ba723406b9725314e2fcc Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Tue, 29 Apr 2025 12:59:35 +0200 Subject: [PATCH] Only send log messages to the LoggingInterfaces if the logging service has been initialized Signed-off-by: Hans Kokx --- lib/src/services/logging/logging_service.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/src/services/logging/logging_service.dart b/lib/src/services/logging/logging_service.dart index 20b130f..6fb0198 100644 --- a/lib/src/services/logging/logging_service.dart +++ b/lib/src/services/logging/logging_service.dart @@ -240,13 +240,15 @@ class ArcaneLogger { // Send logs to registered interface(s) for (final LoggingInterface i in I._interfaces) { - i.log( - message, - level: level, - metadata: metadata, - stackTrace: stackTrace, - extra: extra, - ); + if (initialized) { + i.log( + message, + level: level, + metadata: metadata, + stackTrace: stackTrace, + extra: extra, + ); + } } _logStreamController.add(