aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil/logging.cpp')
-rw-r--r--src/zenutil/logging.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zenutil/logging.cpp b/src/zenutil/logging.cpp
index 6314c407f..0444fa2c4 100644
--- a/src/zenutil/logging.cpp
+++ b/src/zenutil/logging.cpp
@@ -10,6 +10,7 @@ ZEN_THIRD_PARTY_INCLUDES_START
#include <spdlog/spdlog.h>
ZEN_THIRD_PARTY_INCLUDES_END
+#include <zencore/callstack.h>
#include <zencore/compactbinary.h>
#include <zencore/filesystem.h>
#include <zencore/logging.h>
@@ -97,7 +98,13 @@ BeginInitializeLogging(const LoggingOptions& LogOptions)
}
}
- std::set_terminate([]() { ZEN_CRITICAL("Program exited abnormally via std::terminate()"); });
+ std::set_terminate([]() {
+ void* Frames[8];
+ uint32_t FrameCount = GetCallstack(2, 8, Frames);
+ CallstackFrames* Callstack = CreateCallstack(FrameCount, Frames);
+ ZEN_CRITICAL("Program exited abnormally via std::terminate()\n{}", CallstackToString(Callstack, " "));
+ FreeCallstack(Callstack);
+ });
// Default