aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/logging
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/logging')
-rw-r--r--NorthstarDLL/logging/crashhandler.cpp66
-rw-r--r--NorthstarDLL/logging/logging.cpp2
-rw-r--r--NorthstarDLL/logging/logging.h14
-rw-r--r--NorthstarDLL/logging/loghooks.cpp30
-rw-r--r--NorthstarDLL/logging/sourceconsole.h14
5 files changed, 63 insertions, 63 deletions
diff --git a/NorthstarDLL/logging/crashhandler.cpp b/NorthstarDLL/logging/crashhandler.cpp
index 5d120d1f..6cc0f5d3 100644
--- a/NorthstarDLL/logging/crashhandler.cpp
+++ b/NorthstarDLL/logging/crashhandler.cpp
@@ -13,16 +13,16 @@ std::shared_ptr<ExceptionLog> storedException {};
#define RUNTIME_EXCEPTION 3765269347
// clang format did this :/
std::map<int, std::string> ExceptionNames = {
- {EXCEPTION_ACCESS_VIOLATION, "Access Violation"}, {EXCEPTION_IN_PAGE_ERROR, "Access Violation"},
- {EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "Array bounds exceeded"}, {EXCEPTION_DATATYPE_MISALIGNMENT, "Datatype misalignment"},
- {EXCEPTION_FLT_DENORMAL_OPERAND, "Denormal operand"}, {EXCEPTION_FLT_DIVIDE_BY_ZERO, "Divide by zero (float)"},
- {EXCEPTION_FLT_INEXACT_RESULT, "Inexact float result"}, {EXCEPTION_FLT_INVALID_OPERATION, "Invalid operation"},
- {EXCEPTION_FLT_OVERFLOW, "Numeric overflow (float)"}, {EXCEPTION_FLT_STACK_CHECK, "Stack check"},
- {EXCEPTION_FLT_UNDERFLOW, "Numeric underflow (float)"}, {EXCEPTION_ILLEGAL_INSTRUCTION, "Illegal instruction"},
- {EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero (int)"}, {EXCEPTION_INT_OVERFLOW, "Numeric overfloat (int)"},
- {EXCEPTION_INVALID_DISPOSITION, "Invalid disposition"}, {EXCEPTION_NONCONTINUABLE_EXCEPTION, "Non-continuable exception"},
- {EXCEPTION_PRIV_INSTRUCTION, "Priviledged instruction"}, {EXCEPTION_STACK_OVERFLOW, "Stack overflow"},
- {RUNTIME_EXCEPTION, "Uncaught runtime exception:"},
+ {EXCEPTION_ACCESS_VIOLATION, "Access Violation"}, {EXCEPTION_IN_PAGE_ERROR, "Access Violation"},
+ {EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "Array bounds exceeded"}, {EXCEPTION_DATATYPE_MISALIGNMENT, "Datatype misalignment"},
+ {EXCEPTION_FLT_DENORMAL_OPERAND, "Denormal operand"}, {EXCEPTION_FLT_DIVIDE_BY_ZERO, "Divide by zero (float)"},
+ {EXCEPTION_FLT_INEXACT_RESULT, "Inexact float result"}, {EXCEPTION_FLT_INVALID_OPERATION, "Invalid operation"},
+ {EXCEPTION_FLT_OVERFLOW, "Numeric overflow (float)"}, {EXCEPTION_FLT_STACK_CHECK, "Stack check"},
+ {EXCEPTION_FLT_UNDERFLOW, "Numeric underflow (float)"}, {EXCEPTION_ILLEGAL_INSTRUCTION, "Illegal instruction"},
+ {EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero (int)"}, {EXCEPTION_INT_OVERFLOW, "Numeric overfloat (int)"},
+ {EXCEPTION_INVALID_DISPOSITION, "Invalid disposition"}, {EXCEPTION_NONCONTINUABLE_EXCEPTION, "Non-continuable exception"},
+ {EXCEPTION_PRIV_INSTRUCTION, "Priviledged instruction"}, {EXCEPTION_STACK_OVERFLOW, "Stack overflow"},
+ {RUNTIME_EXCEPTION, "Uncaught runtime exception:"},
};
void PrintExceptionLog(ExceptionLog& exc)
@@ -67,10 +67,10 @@ void PrintExceptionLog(ExceptionLog& exc)
if (!IsDedicatedServer())
MessageBoxA(
- 0,
- "Northstar has crashed! Crash info can be found in R2Northstar/logs",
- "Northstar has crashed!",
- MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
+ 0,
+ "Northstar has crashed! Crash info can be found in R2Northstar/logs",
+ "Northstar has crashed!",
+ MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
NS::log::FlushLoggers();
}
@@ -111,16 +111,16 @@ template <> struct fmt::formatter<M128A> : fmt::formatter<string_view>
int v3 = obj.High & INT_MAX;
int v4 = obj.High >> 32;
return fmt::format_to(
- ctx.out(),
- "[ {:G}, {:G}, {:G}, {:G}], [ 0x{:x}, 0x{:x}, 0x{:x}, 0x{:x} ]",
- *reinterpret_cast<float*>(&v1),
- *reinterpret_cast<float*>(&v2),
- *reinterpret_cast<float*>(&v3),
- *reinterpret_cast<float*>(&v4),
- v1,
- v2,
- v3,
- v4);
+ ctx.out(),
+ "[ {:G}, {:G}, {:G}, {:G}], [ 0x{:x}, 0x{:x}, 0x{:x}, 0x{:x} ]",
+ *reinterpret_cast<float*>(&v1),
+ *reinterpret_cast<float*>(&v2),
+ *reinterpret_cast<float*>(&v3),
+ *reinterpret_cast<float*>(&v4),
+ v1,
+ v2,
+ v3,
+ v4);
}
};
@@ -153,7 +153,7 @@ void GenerateTrace(ExceptionLog& exc, bool skipErrorHandlingFrames = true, int n
if (!haveSkippedErrorHandlingFrames)
{
if (!strncmp(backtraceModuleFullName, crashedModuleFullName, MAX_PATH) &&
- !strncmp(backtraceModuleName, crashedModuleName, MAX_PATH))
+ !strncmp(backtraceModuleName, crashedModuleName, MAX_PATH))
{
haveSkippedErrorHandlingFrames = true;
}
@@ -248,13 +248,13 @@ void CreateMiniDump(EXCEPTION_POINTERS* exceptionInfo)
dumpExceptionInfo.ClientPointers = false;
MiniDumpWriteDump(
- GetCurrentProcess(),
- GetCurrentProcessId(),
- hMinidumpFile,
- MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory),
- &dumpExceptionInfo,
- nullptr,
- nullptr);
+ GetCurrentProcess(),
+ GetCurrentProcessId(),
+ hMinidumpFile,
+ MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory),
+ &dumpExceptionInfo,
+ nullptr,
+ nullptr);
CloseHandle(hMinidumpFile);
}
else
@@ -344,7 +344,7 @@ void RuntimeExceptionHandler()
else
{
spdlog::error(
- "std::current_exception() returned nullptr while being handled by RuntimeExceptionHandler. This should never happen!");
+ "std::current_exception() returned nullptr while being handled by RuntimeExceptionHandler. This should never happen!");
std::abort();
}
}
diff --git a/NorthstarDLL/logging/logging.cpp b/NorthstarDLL/logging/logging.cpp
index 2e8605d6..79c6d5c4 100644
--- a/NorthstarDLL/logging/logging.cpp
+++ b/NorthstarDLL/logging/logging.cpp
@@ -63,7 +63,7 @@ void CreateLogFiles()
{
spdlog::error("Failed creating log file!");
MessageBoxA(
- 0, "Failed creating log file! Make sure the profile directory is writable.", "Northstar Warning", MB_ICONWARNING | MB_OK);
+ 0, "Failed creating log file! Make sure the profile directory is writable.", "Northstar Warning", MB_ICONWARNING | MB_OK);
}
}
}
diff --git a/NorthstarDLL/logging/logging.h b/NorthstarDLL/logging/logging.h
index af4b506c..0070c17f 100644
--- a/NorthstarDLL/logging/logging.h
+++ b/NorthstarDLL/logging/logging.h
@@ -119,13 +119,13 @@ class ExternalConsoleSink : public CustomSink
{
private:
std::map<spdlog::level::level_enum, std::string> m_LogColours = {
- {spdlog::level::trace, NS::Colors::TRACE.ToANSIColor()},
- {spdlog::level::debug, NS::Colors::DEBUG.ToANSIColor()},
- {spdlog::level::info, NS::Colors::INFO.ToANSIColor()},
- {spdlog::level::warn, NS::Colors::WARN.ToANSIColor()},
- {spdlog::level::err, NS::Colors::ERR.ToANSIColor()},
- {spdlog::level::critical, NS::Colors::CRIT.ToANSIColor()},
- {spdlog::level::off, NS::Colors::OFF.ToANSIColor()}};
+ {spdlog::level::trace, NS::Colors::TRACE.ToANSIColor()},
+ {spdlog::level::debug, NS::Colors::DEBUG.ToANSIColor()},
+ {spdlog::level::info, NS::Colors::INFO.ToANSIColor()},
+ {spdlog::level::warn, NS::Colors::WARN.ToANSIColor()},
+ {spdlog::level::err, NS::Colors::ERR.ToANSIColor()},
+ {spdlog::level::critical, NS::Colors::CRIT.ToANSIColor()},
+ {spdlog::level::off, NS::Colors::OFF.ToANSIColor()}};
std::string default_color = "\033[39;49m";
diff --git a/NorthstarDLL/logging/loghooks.cpp b/NorthstarDLL/logging/loghooks.cpp
index 53a85c1b..41712c8a 100644
--- a/NorthstarDLL/logging/loghooks.cpp
+++ b/NorthstarDLL/logging/loghooks.cpp
@@ -47,26 +47,26 @@ enum class SpewType_t
};
const std::unordered_map<SpewType_t, const char*> PrintSpewTypes = {
- {SpewType_t::SPEW_MESSAGE, "SPEW_MESSAGE"},
- {SpewType_t::SPEW_WARNING, "SPEW_WARNING"},
- {SpewType_t::SPEW_ASSERT, "SPEW_ASSERT"},
- {SpewType_t::SPEW_ERROR, "SPEW_ERROR"},
- {SpewType_t::SPEW_LOG, "SPEW_LOG"}};
+ {SpewType_t::SPEW_MESSAGE, "SPEW_MESSAGE"},
+ {SpewType_t::SPEW_WARNING, "SPEW_WARNING"},
+ {SpewType_t::SPEW_ASSERT, "SPEW_ASSERT"},
+ {SpewType_t::SPEW_ERROR, "SPEW_ERROR"},
+ {SpewType_t::SPEW_LOG, "SPEW_LOG"}};
// these are used to define the base text colour for these things
const std::unordered_map<SpewType_t, spdlog::level::level_enum> PrintSpewLevels = {
- {SpewType_t::SPEW_MESSAGE, spdlog::level::level_enum::info},
- {SpewType_t::SPEW_WARNING, spdlog::level::level_enum::warn},
- {SpewType_t::SPEW_ASSERT, spdlog::level::level_enum::err},
- {SpewType_t::SPEW_ERROR, spdlog::level::level_enum::err},
- {SpewType_t::SPEW_LOG, spdlog::level::level_enum::info}};
+ {SpewType_t::SPEW_MESSAGE, spdlog::level::level_enum::info},
+ {SpewType_t::SPEW_WARNING, spdlog::level::level_enum::warn},
+ {SpewType_t::SPEW_ASSERT, spdlog::level::level_enum::err},
+ {SpewType_t::SPEW_ERROR, spdlog::level::level_enum::err},
+ {SpewType_t::SPEW_LOG, spdlog::level::level_enum::info}};
const std::unordered_map<SpewType_t, const char> PrintSpewTypes_Short = {
- {SpewType_t::SPEW_MESSAGE, 'M'},
- {SpewType_t::SPEW_WARNING, 'W'},
- {SpewType_t::SPEW_ASSERT, 'A'},
- {SpewType_t::SPEW_ERROR, 'E'},
- {SpewType_t::SPEW_LOG, 'L'}};
+ {SpewType_t::SPEW_MESSAGE, 'M'},
+ {SpewType_t::SPEW_WARNING, 'W'},
+ {SpewType_t::SPEW_ASSERT, 'A'},
+ {SpewType_t::SPEW_ERROR, 'E'},
+ {SpewType_t::SPEW_LOG, 'L'}};
ICenterPrint* pInternalCenterPrint = NULL;
diff --git a/NorthstarDLL/logging/sourceconsole.h b/NorthstarDLL/logging/sourceconsole.h
index 3abcc470..701a9ac9 100644
--- a/NorthstarDLL/logging/sourceconsole.h
+++ b/NorthstarDLL/logging/sourceconsole.h
@@ -68,13 +68,13 @@ class SourceConsoleSink : public CustomSink
{
private:
std::map<spdlog::level::level_enum, SourceColor> m_LogColours = {
- {spdlog::level::trace, NS::Colors::TRACE.ToSourceColor()},
- {spdlog::level::debug, NS::Colors::DEBUG.ToSourceColor()},
- {spdlog::level::info, NS::Colors::INFO.ToSourceColor()},
- {spdlog::level::warn, NS::Colors::WARN.ToSourceColor()},
- {spdlog::level::err, NS::Colors::ERR.ToSourceColor()},
- {spdlog::level::critical, NS::Colors::CRIT.ToSourceColor()},
- {spdlog::level::off, NS::Colors::OFF.ToSourceColor()}};
+ {spdlog::level::trace, NS::Colors::TRACE.ToSourceColor()},
+ {spdlog::level::debug, NS::Colors::DEBUG.ToSourceColor()},
+ {spdlog::level::info, NS::Colors::INFO.ToSourceColor()},
+ {spdlog::level::warn, NS::Colors::WARN.ToSourceColor()},
+ {spdlog::level::err, NS::Colors::ERR.ToSourceColor()},
+ {spdlog::level::critical, NS::Colors::CRIT.ToSourceColor()},
+ {spdlog::level::off, NS::Colors::OFF.ToSourceColor()}};
protected:
void custom_sink_it_(const custom_log_msg& msg);