mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
Check for empty interfaces before initializing them in the logger
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -333,12 +333,12 @@ class ArcaneLogger {
|
||||
/// Initializes all registered [LoggingInterface]s by calling their
|
||||
/// [LoggingInterface.init] methods.
|
||||
Future<ArcaneLogger> 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user