From 06b088d9a188510a2334ed52a0a3d24129f095bb Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Wed, 16 Nov 2022 00:24:38 +0100 Subject: Fix logging (#333) I forgot to update this piece of code to make it so that the file sink gets pushed to all loggers instead of only the `[NORTHSTAR]` one --- NorthstarDLL/logging.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'NorthstarDLL/logging.cpp') diff --git a/NorthstarDLL/logging.cpp b/NorthstarDLL/logging.cpp index 233c360e..2184bd3f 100644 --- a/NorthstarDLL/logging.cpp +++ b/NorthstarDLL/logging.cpp @@ -50,7 +50,10 @@ void CreateLogFiles() stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str()); auto sink = std::make_shared(stream.str(), false); sink->set_pattern("[%H:%M:%S] [%n] [%l] %v"); - spdlog::default_logger()->sinks().push_back(sink); + for (auto& logger : loggers) + { + logger->sinks().push_back(sink); + } spdlog::flush_on(spdlog::level::info); } catch (...) -- cgit v1.2.3