From a21d590b68f43d52477acaee3ce5c0cc4eb81106 Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 24 Jan 2025 14:59:43 +0800 Subject: [PATCH] fix(logging): remove additional space Signed-off-by: xxchan --- core/src/layers/logging.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/layers/logging.rs b/core/src/layers/logging.rs index f7723bc90290..61926fd43fa7 100644 --- a/core/src/layers/logging.rs +++ b/core/src/layers/logging.rs @@ -194,7 +194,7 @@ impl LoggingInterceptor for DefaultLoggingInterceptor { log!( target: LOGGING_TARGET, lvl, - "service={} name={} {}: {operation} {message} {}", + "service={} name={}{}: {operation} {message} {}", info.scheme(), info.name(), LoggingContext(context), @@ -220,7 +220,7 @@ impl LoggingInterceptor for DefaultLoggingInterceptor { log!( target: LOGGING_TARGET, lvl, - "service={} name={} {}: {operation} {message}", + "service={} name={}{}: {operation} {message}", info.scheme(), info.name(), LoggingContext(context), @@ -233,11 +233,7 @@ struct LoggingContext<'a>(&'a [(&'a str, &'a str)]); impl Display for LoggingContext<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { for (i, (k, v)) in self.0.iter().enumerate() { - if i > 0 { - write!(f, " {}={}", k, v)?; - } else { - write!(f, "{}={}", k, v)?; - } + write!(f, " {}={}", k, v)?; } Ok(()) }