tracing icon indicating copy to clipboard operation
tracing copied to clipboard

`with_ansi(false)` has no effect to event in span with arg on 2nd layer

Open wesley800 opened this issue 5 months ago • 1 comments

Bug Report

Version

tracing v0.1.40 tracing-appender v0.2.3 tracing-subscriber v0.3.18 (*) features = ["env-filter"]

Platform

Windows 64bit

Description

Sorry I'm not sure which sub-crate this issue belongs to.

Please check the code at https://gist.github.com/wesley800/7192074d665243adc47b8216a540aa16 . After compile and running (with --release, I didn't test it in debug mode), one should see a new file named test.log and some escape characters in it, only on the second log line. I believe the extra chars are the same within console which add color and bold style to the log.

The problem disappears by doing ANY of the following:

  1. Swap .with(file_layer) and .with(console_layer), which makes file_layer become the first (inner, I guess?) layer.
  2. Delete the span argument arg.
  3. Delete the span. (Of course, cause the first log line behaves normally)

wesley800 avatar Aug 26 '24 17:08 wesley800