From 3849faabb060d58fd7e056aa01445cf1ae3ab0f9 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 11 Dec 2023 11:00:05 +0100 Subject: multi-line logging improvements (#597) * added ZEN_SCOPED_WARN and implemented multi-line logging * changed so file log also uses `fullformatter` for consistency and to get the multi-line support across the board --- src/zenutil/logging.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/zenutil/logging.cpp') diff --git a/src/zenutil/logging.cpp b/src/zenutil/logging.cpp index d82789e42..fedfdc7e8 100644 --- a/src/zenutil/logging.cpp +++ b/src/zenutil/logging.cpp @@ -170,7 +170,8 @@ FinishInitializeLogging(const LoggingOptions& LogOptions) logging::RefreshLogLevels(LogLevel); spdlog::flush_on(spdlog::level::err); spdlog::flush_every(std::chrono::seconds{2}); - spdlog::set_formatter(std::make_unique(LogOptions.LogId, std::chrono::system_clock::now())); + spdlog::set_formatter( + std::make_unique(LogOptions.LogId, std::chrono::system_clock::now())); // default to duration prefix if (g_FileSink) { @@ -180,7 +181,7 @@ FinishInitializeLogging(const LoggingOptions& LogOptions) } else { - g_FileSink->set_pattern("[%C-%m-%d %T.%e] [%n] [%l] %v"); + g_FileSink->set_formatter(std::make_unique(LogOptions.LogId)); // this will have a date prefix } } -- cgit v1.2.3