From 80173f6ee6f3d1a001f098237dc0f9de6b414588 Mon Sep 17 00:00:00 2001 From: haris Date: Thu, 14 Nov 2024 12:57:19 +0530 Subject: [PATCH] chore(logging): add line number to logs --- sn_logging/src/layers.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sn_logging/src/layers.rs b/sn_logging/src/layers.rs index 4bc1f46996..8b75eb2aae 100644 --- a/sn_logging/src/layers.rs +++ b/sn_logging/src/layers.rs @@ -75,11 +75,12 @@ where // Write level and target let level = *event.metadata().level(); let module = event.metadata().module_path().unwrap_or(""); + let lno = event.metadata().line().unwrap_or(0); let time = SystemTime; write!(writer, "[")?; time.format_time(&mut writer)?; - write!(writer, " {level} {module}")?; + write!(writer, " {level} {module} {lno}")?; ctx.visit_spans(|span| write!(writer, "/{}", span.name()))?; write!(writer, "] ")?;