mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Fix
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -281,6 +281,7 @@ dependencies = [
|
||||
"regex",
|
||||
"reqwest 0.12.4",
|
||||
"sentry",
|
||||
"sentry-tracing",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"smallvec",
|
||||
|
||||
@@ -21,6 +21,7 @@ tower-http = { version = "0.5.2", features = ["trace"] }
|
||||
|
||||
tracing = "0.1.40"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"]}
|
||||
sentry-tracing = "0.32.3"
|
||||
|
||||
reqwest = { version = "0.12.4", features = ["json", "stream"] }
|
||||
|
||||
|
||||
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