mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -5,6 +5,9 @@ use std::sync::Arc;
|
||||
use sentry::integrations::debug_images::DebugImagesIntegration;
|
||||
use sentry::types::Dsn;
|
||||
use sentry::ClientOptions;
|
||||
use sentry_tracing::EventFilter;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
|
||||
mod bots;
|
||||
mod bots_manager;
|
||||
@@ -24,7 +27,15 @@ async fn main() {
|
||||
}
|
||||
.add_integration(DebugImagesIntegration::new());
|
||||
|
||||
let _guard = sentry::init(options);
|
||||
let sentry_layer = sentry_tracing::layer().event_filter(|md| match md.level() {
|
||||
&tracing::Level::ERROR => EventFilter::Event,
|
||||
_ => EventFilter::Ignore,
|
||||
});
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(tracing_subscriber::fmt::layer())
|
||||
.with(sentry_layer)
|
||||
.init();
|
||||
|
||||
let running = Arc::new(AtomicBool::new(true));
|
||||
let r = running.clone();
|
||||
|
||||
Reference in New Issue
Block a user