aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zencore/include/zencore/logging.h1
-rw-r--r--src/zencore/logging.cpp8
-rw-r--r--src/zenutil/logging.cpp5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/logging.h b/src/zencore/include/zencore/logging.h
index afbbbd3ee..74a44d028 100644
--- a/src/zencore/include/zencore/logging.h
+++ b/src/zencore/include/zencore/logging.h
@@ -31,6 +31,7 @@ void FlushLogging();
LoggerRef Default();
void SetDefault(std::string_view NewDefaultLoggerId);
LoggerRef ConsoleLog();
+void ResetConsoleLog();
void SuppressConsoleLog();
LoggerRef ErrorLog();
void SetErrorLog(std::string_view LoggerId);
diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp
index a6697c443..77e05a909 100644
--- a/src/zencore/logging.cpp
+++ b/src/zencore/logging.cpp
@@ -405,6 +405,14 @@ ConsoleLog()
}
void
+ResetConsoleLog()
+{
+ LoggerRef ConLog = ConsoleLog();
+
+ ConLog.SpdLogger->set_pattern("%v");
+}
+
+void
InitializeLogging()
{
ZEN_MEMSCOPE(ELLMTag::Logging);
diff --git a/src/zenutil/logging.cpp b/src/zenutil/logging.cpp
index 806b96d52..54ac30c5d 100644
--- a/src/zenutil/logging.cpp
+++ b/src/zenutil/logging.cpp
@@ -233,6 +233,11 @@ FinishInitializeLogging(const LoggingOptions& LogOptions)
LogOptions.LogId,
std::chrono::system_clock::now() - std::chrono::milliseconds(GetTimeSinceProcessStart()))); // default to duration prefix
+ // If the console logger was initialized before, the above will change the output format
+ // so we need to reset it
+
+ logging::ResetConsoleLog();
+
if (g_FileSink)
{
if (LogOptions.AbsLogFile.extension() == ".json")