Skip to content

Commit

Permalink
setup sentry in Bevy by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Apr 26, 2024
1 parent 70f33fe commit f4d4ea3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/workflow-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
split-pages:
name: Prepare pages
runs-on: ubuntu-latest
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
outputs:
pages: ${{ steps.env.outputs.pages }}
steps:
Expand Down Expand Up @@ -74,6 +76,12 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Sentry Reporting
shell: pwsh
run: |
cargo add vleue_sentry --git https://github.com/vleue/vleue_sentry -p bevy_internal
git apply --ignore-whitespace add_sentry.patch
- name: Install Bevy dependencies
if: runner.os == 'linux'
run: |
Expand Down
16 changes: 16 additions & 0 deletions add_sentry.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs
index acfa89d0b6..516a16ca9c 100644
--- a/crates/bevy_internal/src/default_plugins.rs
+++ b/crates/bevy_internal/src/default_plugins.rs
@@ -44,7 +44,10 @@ impl PluginGroup for DefaultPlugins {
let mut group = PluginGroupBuilder::start::<Self>();
group = group
.add(bevy_app::PanicHandlerPlugin)
- .add(bevy_log::LogPlugin::default())
+ .add(bevy_log::LogPlugin {
+ update_subscriber: Some(vleue_sentry::sentry_error_reporter),
+ ..Default::default()
+ })
.add(bevy_core::TaskPoolPlugin::default())
.add(bevy_core::TypeRegistrationPlugin)
.add(bevy_core::FrameCountPlugin)

0 comments on commit f4d4ea3

Please sign in to comment.