From 7e338fac5c15a3cd6efdd570a93e6d8586856143 Mon Sep 17 00:00:00 2001 From: Emma Miler <27428383+emma-miler@users.noreply.github.com> Date: Sun, 30 Jan 2022 20:32:33 +0100 Subject: Added command line option for custom northstar dir Added command line option for custom northstar dir https://github.com/orgs/R2Northstar/projects/1#card-76312632 --- NorthstarDedicatedTest/logging.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'NorthstarDedicatedTest/logging.cpp') diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp index 9fc39cde..136fdf9b 100644 --- a/NorthstarDedicatedTest/logging.cpp +++ b/NorthstarDedicatedTest/logging.cpp @@ -9,6 +9,7 @@ #include #include #include +#include "configurables.h" // This needs to be called after hooks are loaded so we can access the command line args @@ -25,7 +26,7 @@ void CreateLogFiles() tm currentTime = *std::localtime(&time); std::stringstream stream; - stream << std::put_time(¤tTime, "R2Northstar/logs/nslog%Y-%m-%d %H-%M-%S.txt"); + stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str()); spdlog::default_logger()->sinks().push_back(std::make_shared(stream.str(), false)); spdlog::flush_on(spdlog::level::info); } @@ -175,7 +176,7 @@ long __stdcall ExceptionFilter(EXCEPTION_POINTERS* exceptionInfo) time_t time = std::time(nullptr); tm currentTime = *std::localtime(&time); std::stringstream stream; - stream << std::put_time(¤tTime, "R2Northstar/logs/nsdump%Y-%m-%d %H-%M-%S.dmp"); + stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nsdump%Y-%m-%d %H-%M-%S.dmp").c_str()); auto hMinidumpFile = CreateFileA(stream.str().c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hMinidumpFile) -- cgit v1.2.3