Merge branch 'rewrite-to-rust' of https://github.com/flibusta-apps/telegram_files_server into rewrite-to-rust

This commit is contained in:
Шатунов Антон
2024-05-07 00:35:09 +03:00
3 changed files with 13 additions and 4 deletions

1
Cargo.lock generated
View File

@@ -2051,6 +2051,7 @@ dependencies = [
"once_cell",
"reqwest 0.11.23",
"sentry",
"sentry-tracing",
"serde",
"serde_json",
"teloxide",

View File

@@ -13,6 +13,7 @@ axum_typed_multipart = "0.11.1"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"]}
tower-http = { version = "0.5.2", features = ["trace"] }
sentry-tracing = "0.32.3"
tokio = "1.37.0"
tokio-util = { version = "0.7.11", features = [ "full" ] }

View File

@@ -3,6 +3,8 @@ mod core;
use std::{net::SocketAddr, str::FromStr};
use sentry::{integrations::debug_images::DebugImagesIntegration, types::Dsn, ClientOptions};
use sentry_tracing::EventFilter;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use crate::core::views::get_router;
@@ -20,9 +22,14 @@ 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(sentry_layer)
.init();
let addr = SocketAddr::from(([0, 0, 0, 0], 8080));