aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/logging.cpp
diff options
context:
space:
mode:
authorEmma Miler <27428383+emma-miler@users.noreply.github.com>2022-01-30 20:32:33 +0100
committerEmma Miler <27428383+emma-miler@users.noreply.github.com>2022-01-30 20:32:33 +0100
commit7e338fac5c15a3cd6efdd570a93e6d8586856143 (patch)
tree910dae9926776e39462153f7a135dbd9c9eef7a8 /NorthstarDedicatedTest/logging.cpp
parenta589bb0082cbae6d326644292179c9427e76e795 (diff)
downloadNorthstarLauncher-7e338fac5c15a3cd6efdd570a93e6d8586856143.tar.gz
NorthstarLauncher-7e338fac5c15a3cd6efdd570a93e6d8586856143.zip
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
Diffstat (limited to 'NorthstarDedicatedTest/logging.cpp')
-rw-r--r--NorthstarDedicatedTest/logging.cpp5
1 files changed, 3 insertions, 2 deletions
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 <sstream>
#include <Psapi.h>
#include <minidumpapiset.h>
+#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(&currentTime, "R2Northstar/logs/nslog%Y-%m-%d %H-%M-%S.txt");
+ stream << std::put_time(&currentTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str());
spdlog::default_logger()->sinks().push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(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(&currentTime, "R2Northstar/logs/nsdump%Y-%m-%d %H-%M-%S.dmp");
+ stream << std::put_time(&currentTime, (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)