mirror of
https://github.com/flibusta-apps/batch_downloader.git
synced 2025-12-06 06:15:37 +01:00
Fix
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -245,6 +245,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"reqwest",
|
||||
"sentry",
|
||||
"sentry-tracing",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"smallvec",
|
||||
|
||||
@@ -13,6 +13,7 @@ futures-util = "0.3.30"
|
||||
|
||||
tracing = "0.1.40"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"]}
|
||||
sentry-tracing = "0.32.3"
|
||||
tower-http = { version = "0.5.2", features = ["trace"] }
|
||||
|
||||
once_cell = "1.19.0"
|
||||
|
||||
13
src/main.rs
13
src/main.rs
@@ -4,8 +4,10 @@ pub mod structures;
|
||||
pub mod views;
|
||||
|
||||
use sentry::{integrations::debug_images::DebugImagesIntegration, types::Dsn, ClientOptions};
|
||||
use sentry_tracing::EventFilter;
|
||||
use std::{net::SocketAddr, str::FromStr};
|
||||
use tracing::info;
|
||||
use tracing_subscriber::{filter, layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
use crate::views::get_router;
|
||||
|
||||
@@ -36,5 +38,16 @@ async fn main() {
|
||||
|
||||
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_target(false))
|
||||
.with(filter::LevelFilter::INFO)
|
||||
.with(sentry_layer)
|
||||
.init();
|
||||
|
||||
start_app().await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user