Skip to content

Commit

Permalink
chore(logging): add line number to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
harismuzaffer committed Nov 14, 2024
1 parent d0e6faf commit 80173f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sn_logging/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ where
// Write level and target
let level = *event.metadata().level();
let module = event.metadata().module_path().unwrap_or("<unknown module>");
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, "] ")?;

Expand Down

0 comments on commit 80173f6

Please sign in to comment.