diff options
| author | Stefan Boberg <[email protected]> | 2021-11-03 21:52:34 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-03 21:52:34 +0100 |
| commit | 5531cd5b61654454b7244856d2c8e1c4bfe8498c (patch) | |
| tree | 16e82a9fa795263376c3b63dff98857d54450b9e | |
| parent | More .gitignore cleanup (diff) | |
| parent | log: improved log pattern for file log to make it easier to consume file logs... (diff) | |
| download | zen-5531cd5b61654454b7244856d2c8e1c4bfe8498c.tar.xz zen-5531cd5b61654454b7244856d2c8e1c4bfe8498c.zip | |
Merge branch 'gc' of https://github.com/EpicGames/zen into gc
| -rw-r--r-- | zenserver/diag/logging.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zenserver/diag/logging.cpp b/zenserver/diag/logging.cpp index 74c5c2101..728001202 100644 --- a/zenserver/diag/logging.cpp +++ b/zenserver/diag/logging.cpp @@ -16,7 +16,10 @@ ZEN_THIRD_PARTY_INCLUDES_START #include <spdlog/sinks/stdout_color_sinks.h> ZEN_THIRD_PARTY_INCLUDES_END +#include <zencore/filesystem.h> #include <zencore/string.h> + +#include <chrono> #include <memory> // Custom logging -- test code, this should be tweaked @@ -236,7 +239,7 @@ InitializeLogging(const ZenServerOptions& GlobalOptions) /* truncate */ false, uint16_t(/* max files */ 14)); #else - auto FileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(zen::WideToUtf8(LogPath.c_str()), + auto FileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(zen::ToUtf8(LogPath), /* max size */ 128 * 1024 * 1024, /* max files */ 16, /* rotate on open */ true); @@ -288,6 +291,10 @@ InitializeLogging(const ZenServerOptions& GlobalOptions) spdlog::flush_on(spdlog::level::err); spdlog::flush_every(std::chrono::seconds{2}); spdlog::set_formatter(std::make_unique<logging::full_formatter>(GlobalOptions.LogId, std::chrono::system_clock::now())); + + FileSink->set_pattern("[%C-%m-%d.%e %T] [%n] [%l] %v"); + + spdlog::info("log starting at {:%FT%T%z}", std::chrono::system_clock::now()); } void |