From 7926ac015afe44555dec9590839b082355bb45fd Mon Sep 17 00:00:00 2001 From: houseme Date: Thu, 24 Apr 2025 19:14:46 +0800 Subject: [PATCH] improve code for tracing log --- rustfs/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index ba1579abd..c3ea69e94 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -335,20 +335,20 @@ async fn run(opt: config::Opt) -> Result<()> { span }) .on_request(|request: &HttpRequest<_>, _span: &Span| { - debug!("started method: {}, url path: {}", request.method(), request.uri().path()) + debug!("http started method: {}, url path: {}", request.method(), request.uri().path()) }) .on_response(|response: &Response<_>, latency: Duration, _span: &Span| { - _span.record("status_code", tracing::field::display(response.status())); - debug!("response generated in {:?}", latency) + _span.record("http response status_code", tracing::field::display(response.status())); + debug!("http response generated in {:?}", latency) }) .on_body_chunk(|chunk: &Bytes, latency: Duration, _span: &Span| { - debug!("sending {} bytes in {:?}", chunk.len(), latency) + debug!("http body sending {} bytes in {:?}", chunk.len(), latency) }) .on_eos(|_trailers: Option<&HeaderMap>, stream_duration: Duration, _span: &Span| { - debug!("stream closed after {:?}", stream_duration) + debug!("http stream closed after {:?}", stream_duration) }) .on_failure(|_error, latency: Duration, _span: &Span| { - debug!("request error: {:?} in {:?}", _error, latency) + debug!("http request failure error: {:?} in {:?}", _error, latency) }), ) .layer(CorsLayer::permissive())