diagnostics

log checksum

Update WorldServer.cpp

Update WorldServer.cpp

lotta this

Update WorldServer.cpp

Update WorldServer.cpp

Update WorldServer.cpp

Update Logger.cpp

logs

Update WorldServer.cpp
This commit is contained in:
EmosewaMC
2024-12-26 02:30:04 -08:00
committed by David Markowitz
parent 0c948a8df6
commit c305af7172
3 changed files with 126 additions and 123 deletions

View File

@@ -1,7 +1,7 @@
#include "Diagnostics.h"
#include "Game.h"
#include "Logger.h"
#define _XOPEN_SOURCE
// If we're on Win32, we'll include our minidump writer
#ifdef _WIN32
@@ -60,7 +60,7 @@ LONG CALLBACK unhandled_handler(EXCEPTION_POINTERS* e) {
}
#endif
#if defined(__linux__) //&& !defined(__clang__) // backtrace is a gcc exclusive system library
// #if defined(__linux__) //&& !defined(__clang__) // backtrace is a gcc exclusive system library
#include <execinfo.h>
#include <ucontext.h>
#include <unistd.h>
@@ -219,16 +219,16 @@ void MakeBacktrace() {
std::set_terminate(OnTerminate);
}
#endif
// #endif
void Diagnostics::Initialize() {
#ifdef _WIN32
SetUnhandledExceptionFilter(unhandled_handler);
#elif defined(__linux__) //&& !defined(__clang__)
// #ifdef _WIN32
// SetUnhandledExceptionFilter(unhandled_handler);
// #elif defined(__linux__) //&& !defined(__clang__)
MakeBacktrace();
#else
fprintf(stderr, "Diagnostics not supported on this platform.\n");
#endif
// #else
// fprintf(stderr, "Diagnostics not supported on this platform.\n");
// #endif
}
std::string Diagnostics::m_ProcessName{};

View File

@@ -58,6 +58,7 @@ void Logger::vLog(const char* format, va_list args) {
for (const auto& writer : m_Writers) {
writer->Log(timeStr, message);
}
Flush();
}
void Logger::Log(const char* className, const char* format, ...) {