From 1026d8a1d1dca7cf5f4182c8398260af27f7a511 Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 24 Jan 2025 15:14:21 +0800 Subject: [PATCH] fix(logging): remove additional space (#5568) --- core/src/layers/logging.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/src/layers/logging.rs b/core/src/layers/logging.rs index f7723bc90290..3dfaea31a625 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), @@ -232,12 +232,8 @@ 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)?; - } + for (k, v) in self.0.iter() { + write!(f, " {}={}", k, v)?; } Ok(()) }