mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +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
|
/// Initializes all registered [LoggingInterface]s by calling their
|
||||||
/// [LoggingInterface.init] methods.
|
/// [LoggingInterface.init] methods.
|
||||||
Future<ArcaneLogger> initializeInterfaces() async {
|
Future<ArcaneLogger> initializeInterfaces() async {
|
||||||
if (!initialized) await _init();
|
|
||||||
|
|
||||||
if (I._interfaces.isEmptyOrNull) {
|
if (I._interfaces.isEmptyOrNull) {
|
||||||
throw Exception("No logging interfaces have been registered.");
|
throw Exception("No logging interfaces have been registered.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!initialized) await _init();
|
||||||
|
|
||||||
for (final LoggingInterface i in I._interfaces) {
|
for (final LoggingInterface i in I._interfaces) {
|
||||||
if (!i.initialized) await i.init();
|
if (!i.initialized) await i.init();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user