This commit is contained in:
2024-05-06 23:43:25 +02:00
parent d61b317738
commit b2951c71c9
3 changed files with 13 additions and 3 deletions

View File

@@ -6,8 +6,10 @@ pub mod views;
use dotenv::dotenv;
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;
@@ -24,9 +26,15 @@ async fn main() {
let _guard = sentry::init(options);
tracing_subscriber::fmt()
.with_target(false)
.compact()
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();
let addr = SocketAddr::from(([0, 0, 0, 0], 8080));