diff options
author | unknown <for.oliver.kirkham@gmail.com> | 2023-02-13 13:51:40 +0000 |
---|---|---|
committer | BobTheBob <for.oliver.kirkham@gmail.com> | 2023-02-22 22:18:56 +0000 |
commit | 93871f36c2e36996d880aa68d6445c7d3802c100 (patch) | |
tree | fb1dfd1555eb9b4bc061394cd78856667d48fe4a /NorthstarDLL/logging | |
parent | 07e386b12cb1a92c99cd5e3034cb4f94f28fb3eb (diff) | |
download | NorthstarLauncher-93871f36c2e36996d880aa68d6445c7d3802c100.tar.gz NorthstarLauncher-93871f36c2e36996d880aa68d6445c7d3802c100.zip |
refactor modloading and implement initial automatic reload code
Diffstat (limited to 'NorthstarDLL/logging')
-rw-r--r-- | NorthstarDLL/logging/crashhandler.cpp | 11 | ||||
-rw-r--r-- | NorthstarDLL/logging/logging.cpp | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/NorthstarDLL/logging/crashhandler.cpp b/NorthstarDLL/logging/crashhandler.cpp index 38d9312f..36f8b714 100644 --- a/NorthstarDLL/logging/crashhandler.cpp +++ b/NorthstarDLL/logging/crashhandler.cpp @@ -33,16 +33,15 @@ void PrintExceptionLog(ExceptionLog& exc) if (g_pModManager) { spdlog::error("Loaded mods: "); - for (const Mod& mod : g_pModManager->GetMods()) - { - if (mod.m_bEnabled) - spdlog::error("{} {}", mod.Name, mod.Version); - } + for (const Mod& mod : g_pModManager->GetMods() | ModManager::FilterEnabled) + spdlog::error("{} {}", mod.Name, mod.Version); } + spdlog::error(exc.cause); // If this was a runtime error, print the message if (exc.runtimeInfo.length() != 0) spdlog::error("\"{}\"", exc.runtimeInfo); + spdlog::error("At: {} + {}", exc.trace[0].name, exc.trace[0].relativeAddress); spdlog::error(""); spdlog::error("Stack trace:"); @@ -235,7 +234,7 @@ void CreateMiniDump(EXCEPTION_POINTERS* exceptionInfo) time_t time = std::time(nullptr); tm currentTime = *std::localtime(&time); std::stringstream stream; - stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nsdump%Y-%m-%d %H-%M-%S.dmp").c_str()); + stream << std::put_time(¤tTime, (GetNorthstarPrefix() / "logs/nsdump%Y-%m-%d %H-%M-%S.dmp").string().c_str()); auto hMinidumpFile = CreateFileA(stream.str().c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hMinidumpFile) diff --git a/NorthstarDLL/logging/logging.cpp b/NorthstarDLL/logging/logging.cpp index f88928e1..edf122be 100644 --- a/NorthstarDLL/logging/logging.cpp +++ b/NorthstarDLL/logging/logging.cpp @@ -46,7 +46,7 @@ void CreateLogFiles() tm currentTime = *std::localtime(&time); std::stringstream stream; - stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nslog%Y-%m-%d %H-%M-%S.txt").c_str()); + stream << std::put_time(¤tTime, (GetNorthstarPrefix() / "logs/nslog%Y-%m-%d %H-%M-%S.txt").string().c_str()); auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(stream.str(), false); sink->set_pattern("[%H:%M:%S] [%n] [%l] %v"); for (auto& logger : loggers) |