mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Logging] Add stack trace in code paths that shouldn't occur (#2453)
* [Logging] Add stack trace in code paths that shouldn't occur * Update zone_store.cpp * Windows workaround
This commit is contained in:
@@ -650,6 +650,7 @@ SET(common_headers
|
||||
patches/uf_limits.h
|
||||
patches/uf_ops.h
|
||||
patches/uf_structs.h
|
||||
stacktrace/backward.hpp
|
||||
StackWalker/StackWalker.h
|
||||
util/memory_stream.h
|
||||
util/directory.h
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+12
-1
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "zone_store.h"
|
||||
#include "../common/content/world_content_service.h"
|
||||
#include "stacktrace/backward.hpp"
|
||||
|
||||
ZoneStore::ZoneStore() = default;
|
||||
ZoneStore::~ZoneStore() = default;
|
||||
@@ -82,11 +83,21 @@ const char *ZoneStore::GetZoneName(uint32 zone_id, bool error_unknown)
|
||||
}
|
||||
|
||||
LogInfo(
|
||||
"[GetZoneName] Failed to get zone name by zone_id [{}] error_unknown [{}]",
|
||||
"[GetZoneName] Failed to get zone name by zone_id [{}] error_unknown [{}] printing stack",
|
||||
zone_id,
|
||||
(error_unknown ? "true" : "false")
|
||||
);
|
||||
|
||||
|
||||
// print stack when invalid input
|
||||
if (zone_id == 0) {
|
||||
backward::StackTrace st;
|
||||
backward::TraceResolver e = {};
|
||||
st.load_here(32);
|
||||
backward::Printer p;
|
||||
p.print(st);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user