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::ServiceBuilder;
|
||||||
use tower_http::{
|
use tower_http::{
|
||||||
catch_panic::CatchPanicLayer,
|
catch_panic::CatchPanicLayer,
|
||||||
classify::ServerErrorsFailureClass,
|
|
||||||
cors::{self, CorsLayer},
|
cors::{self, CorsLayer},
|
||||||
trace::{DefaultOnFailure, DefaultOnRequest, DefaultOnResponse, TraceLayer},
|
trace::{DefaultOnFailure, DefaultOnRequest, DefaultOnResponse, TraceLayer},
|
||||||
ServiceBuilderExt as _,
|
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 tracing_subscriber::{prelude::*, reload, EnvFilter, Registry};
|
||||||
use utils::{
|
use utils::{
|
||||||
clap,
|
clap,
|
||||||
|
@ -456,16 +455,14 @@ fn compression_layer(server: &Server) -> tower_http::compression::CompressionLay
|
||||||
compression_layer
|
compression_layer
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tracing_span<T>(request: &http::Request<T>) -> Span {
|
fn tracing_span<T>(request: &http::Request<T>) -> tracing::Span {
|
||||||
let path = request.extensions().get::<MatchedPath>();
|
let path = if let Some(path) = request.extensions().get::<MatchedPath>() {
|
||||||
let uri = &request.uri().to_string();
|
path.as_str()
|
||||||
|
|
||||||
if let Some(path) = path {
|
|
||||||
let path = path.as_str();
|
|
||||||
tracing::info_span!("router:", %path, %uri)
|
|
||||||
} else {
|
} else {
|
||||||
tracing::info_span!("router:", %uri)
|
&request.uri().to_string()
|
||||||
}
|
};
|
||||||
|
|
||||||
|
tracing::info_span!("router:", %path)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Non-async initializations
|
/// Non-async initializations
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue