mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
Dont use logger after Shutdown (#4302)
* Only flush log if not Shutdown * Fix null logger deref, copy it
This commit is contained in:
parent
dcdbd174d2
commit
2b7d54f785
@ -242,7 +242,12 @@ void Shutdown() {
|
||||
}
|
||||
|
||||
void Flush() {
|
||||
g_shad_file_sink->flush();
|
||||
g_console_sink->flush();
|
||||
if (g_shad_file_sink != nullptr) {
|
||||
g_shad_file_sink->flush();
|
||||
}
|
||||
|
||||
if (g_console_sink != nullptr) {
|
||||
g_console_sink->flush();
|
||||
}
|
||||
}
|
||||
} // namespace Common::Log
|
||||
|
||||
@ -37,7 +37,11 @@ void Flush();
|
||||
|
||||
// Define the fmt lib macros
|
||||
#define LOG_GENERIC(log_class, log_level, ...) \
|
||||
SPDLOG_LOGGER_CALL(Common::Log::ALL_LOGGERS[log_class], log_level, __VA_ARGS__)
|
||||
do { \
|
||||
if (auto logger = Common::Log::ALL_LOGGERS[log_class]) { \
|
||||
SPDLOG_LOGGER_CALL(logger, log_level, __VA_ARGS__); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define LOG_TRACE(log_class, ...) \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user