diff --git a/core/src/layers/logging.rs b/core/src/layers/logging.rs index f7723bc9029..61926fd43fa 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(()) }