diff options
| author | Stefan Boberg <[email protected]> | 2023-12-11 11:00:05 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-11 11:00:05 +0100 |
| commit | 3849faabb060d58fd7e056aa01445cf1ae3ab0f9 (patch) | |
| tree | cc57edd3ead53129ed41fc486a6b13c2dca52af4 /src/zenutil/logging.cpp | |
| parent | SuppressConsoleLog now removes any existing console logger (#599) (diff) | |
| download | zen-3849faabb060d58fd7e056aa01445cf1ae3ab0f9.tar.xz zen-3849faabb060d58fd7e056aa01445cf1ae3ab0f9.zip | |
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
Diffstat (limited to 'src/zenutil/logging.cpp')
| -rw-r--r-- | src/zenutil/logging.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<logging::full_formatter>(LogOptions.LogId, std::chrono::system_clock::now())); + spdlog::set_formatter( + std::make_unique<logging::full_formatter>(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<logging::full_formatter>(LogOptions.LogId)); // this will have a date prefix } } |