From 1560c8a704b1c9b7f97675edaed790df9983bccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 14 Jan 2021 17:04:41 +0100 Subject: [PATCH] Log target before prefix for more consistent logging (#7897) * Log target before prefix for more consistent logging As requested, this moves the target before the prefix to have consistent logging between logs with and without a prefix. * Add a space --- substrate/client/tracing/src/logging.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/substrate/client/tracing/src/logging.rs b/substrate/client/tracing/src/logging.rs index 248c91feb8..c552d64bc7 100644 --- a/substrate/client/tracing/src/logging.rs +++ b/substrate/client/tracing/src/logging.rs @@ -125,6 +125,10 @@ where } } + if self.display_target { + write!(writer, "{}: ", meta.target())?; + } + // Custom code to display node name if let Some(span) = ctx.lookup_current() { let parents = span.parents(); @@ -137,9 +141,6 @@ where } } - if self.display_target { - write!(writer, "{}:", meta.target())?; - } ctx.format_fields(writer, event)?; writeln!(writer)?;