aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/logging.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-11 10:45:45 +0100
committerGitHub <[email protected]>2023-12-11 10:45:45 +0100
commit25139130fd1130a35a3381ccb143d3adc8c69d07 (patch)
tree488e692a4f9e9749061d5bbedeee33b6b4403586 /src/zencore/logging.cpp
parentfix deadlock at bucket creation (#598) (diff)
downloadzen-25139130fd1130a35a3381ccb143d3adc8c69d07.tar.xz
zen-25139130fd1130a35a3381ccb143d3adc8c69d07.zip
SuppressConsoleLog now removes any existing console logger (#599)
SuppressConsoleLog now removes any existing console logger to avoid exceptions in spdlog
Diffstat (limited to 'src/zencore/logging.cpp')
-rw-r--r--src/zencore/logging.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp
index 0bf07affd..90f4e2428 100644
--- a/src/zencore/logging.cpp
+++ b/src/zencore/logging.cpp
@@ -328,6 +328,11 @@ std::shared_ptr<spdlog::logger> ConLogger;
void
SuppressConsoleLog()
{
+ if (ConLogger)
+ {
+ spdlog::drop("console");
+ ConLogger = {};
+ }
ConLogger = spdlog::null_logger_mt("console");
}