From 599ade3981d605f90835dfd0e99454217f9644e7 Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Tue, 29 Apr 2025 13:05:03 +0200 Subject: [PATCH] Check for empty interfaces before initializing them in the logger Signed-off-by: Hans Kokx --- lib/src/services/logging/logging_service.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/services/logging/logging_service.dart b/lib/src/services/logging/logging_service.dart index 6fb0198..6994add 100644 --- a/lib/src/services/logging/logging_service.dart +++ b/lib/src/services/logging/logging_service.dart @@ -333,12 +333,12 @@ class ArcaneLogger { /// Initializes all registered [LoggingInterface]s by calling their /// [LoggingInterface.init] methods. Future initializeInterfaces() async { - if (!initialized) await _init(); - if (I._interfaces.isEmptyOrNull) { throw Exception("No logging interfaces have been registered."); } + if (!initialized) await _init(); + for (final LoggingInterface i in I._interfaces) { if (!i.initialized) await i.init(); }