From 1fd6883e242522d0b822baf280873ebf98fd1c51 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 25 Oct 2023 17:42:16 +0200 Subject: eliminate redundant logging code (#499) zenutil and zenserver both contain very similar logging setup code and this change aims to make them have most code in common. * fullformatter/jsonformatter/RotatingFileSink are moved into dedicated header files in zenutil * zenserver `InitializeLogging`/`ShutdownLogging` are renamed `InitializeServerLogging`/`InitializeServerLogging` * these now call into the common zenutil `BeginInitializeLogging`/`FinishInitializeLogging` in addition to setting up server custom logging * `std::filesystem::path` is now logged after stripping any `\\\\?\\` prefix for readability --- src/zenserver/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zenserver/main.cpp') diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp index f482e6737..b83964319 100644 --- a/src/zenserver/main.cpp +++ b/src/zenserver/main.cpp @@ -150,7 +150,7 @@ ZenEntryPoint::Run() std::exit(99); } - InitializeLogging(m_ServerOptions); + InitializeServerLogging(m_ServerOptions); #if ZEN_USE_SENTRY Sentry.LogStartupInformation(); @@ -251,7 +251,7 @@ ZenEntryPoint::Run() } } - ShutdownLogging(); + ShutdownServerLogging(); return ApplicationExitCode(); } -- cgit v1.2.3