summaryrefslogtreecommitdiff
path: root/engine/src
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src')
-rw-r--r--engine/src/renderer/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs
index cc1631f..8ca85e2 100644
--- a/engine/src/renderer/mod.rs
+++ b/engine/src/renderer/mod.rs
@@ -63,6 +63,8 @@ fn opengl_debug_message_cb(
message: &str,
)
{
+ use std::backtrace::{Backtrace, BacktraceStatus};
+
use tracing::{event, Level};
macro_rules! create_event {
@@ -74,6 +76,12 @@ fn opengl_debug_message_cb(
match ty {
MessageType::Error => {
create_event!(Level::ERROR);
+
+ let backtrace = Backtrace::capture();
+
+ if matches!(backtrace.status(), BacktraceStatus::Captured) {
+ event!(Level::TRACE, "{backtrace}");
+ }
}
MessageType::Other => {
create_event!(Level::INFO);