diff --git a/Source/Logging/Logger.cpp b/Source/Logging/Logger.cpp index ab8df44c..b2c4002d 100644 --- a/Source/Logging/Logger.cpp +++ b/Source/Logging/Logger.cpp @@ -216,26 +216,31 @@ namespace Aurora::Logging } } + static void ForceFlushLogger(Logger *logger) + { + for (const auto &sink : logger->sinks) + { + if (!sink) + { + continue; + } + + try + { + sink->OnFlush(); + } + catch (...) + { + SysPushErrorCatch(); + } + } + } + void ForceFlushFlushNoLock() { for (const auto &logger : gFlushableLoggers) { - for (const auto &sink : logger->sinks) - { - if (!sink) - { - continue; - } - - try - { - sink->OnFlush(); - } - catch (...) - { - SysPushErrorCatch(); - } - } + ForceFlushLogger(logger); } } @@ -251,7 +256,7 @@ namespace Aurora::Logging AU_LOCK_GUARD(gGlobalSpin); ForceFlushLoggersNoLock(); - ForceFlushFlushNoLock(); + ForceFlushLogger(this); { AU_LOCK_GUARD(spin);