mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
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:

committed by
David Markowitz

parent
0c948a8df6
commit
c305af7172
@@ -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{};
|
||||
|
@@ -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, ...) {
|
||||
|
Reference in New Issue
Block a user