partially revert this in main.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e90ab8ec8e
commit
d91f24d841
1 changed files with 8 additions and 11 deletions
19
src/main.rs
19
src/main.rs
|
@ -38,12 +38,11 @@ use tokio::{
|
|||
use tower::ServiceBuilder;
|
||||
use tower_http::{
|
||||
catch_panic::CatchPanicLayer,
|
||||
classify::ServerErrorsFailureClass,
|
||||
cors::{self, CorsLayer},
|
||||
trace::{DefaultOnFailure, DefaultOnRequest, DefaultOnResponse, TraceLayer},
|
||||
ServiceBuilderExt as _,
|
||||
};
|
||||
use tracing::{debug, error, info, trace, warn, Level, Span};
|
||||
use tracing::{debug, error, info, trace, warn, Level};
|
||||
use tracing_subscriber::{prelude::*, reload, EnvFilter, Registry};
|
||||
use utils::{
|
||||
clap,
|
||||
|
@ -456,16 +455,14 @@ fn compression_layer(server: &Server) -> tower_http::compression::CompressionLay
|
|||
compression_layer
|
||||
}
|
||||
|
||||
fn tracing_span<T>(request: &http::Request<T>) -> Span {
|
||||
let path = request.extensions().get::<MatchedPath>();
|
||||
let uri = &request.uri().to_string();
|
||||
|
||||
if let Some(path) = path {
|
||||
let path = path.as_str();
|
||||
tracing::info_span!("router:", %path, %uri)
|
||||
fn tracing_span<T>(request: &http::Request<T>) -> tracing::Span {
|
||||
let path = if let Some(path) = request.extensions().get::<MatchedPath>() {
|
||||
path.as_str()
|
||||
} else {
|
||||
tracing::info_span!("router:", %uri)
|
||||
}
|
||||
&request.uri().to_string()
|
||||
};
|
||||
|
||||
tracing::info_span!("router:", %path)
|
||||
}
|
||||
|
||||
/// Non-async initializations
|
||||
|
|
Loading…
Add table
Reference in a new issue