Skip to content

Commit

Permalink
get executable name
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Apr 26, 2024
1 parent f85b084 commit d03f4d4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)]
#![doc = include_str!("../README.md")]

use std::env;
use std::{env, path::PathBuf};

#[cfg(all(feature = "bevy", not(feature = "subcrates")))]
use bevy::{
Expand Down Expand Up @@ -85,6 +85,16 @@ pub fn sentry_panic_reporter(_: &mut App, subscriber: BoxedSubscriber) -> BoxedS
..Default::default()
},
));
env::args().next().and_then(|file| {
PathBuf::from(file)
.file_name()
.and_then(|file| file.to_str())
.map(|exe| {
sentry::configure_scope(|scope| {
scope.set_tag("executable", dbg!(exe));
});
})
});

Box::new(subscriber.with(SentryLayer {
guard,
Expand Down

0 comments on commit d03f4d4

Please sign in to comment.