Open wmmc88 opened 9 months ago
Hmm afaik the matching for field values only works with spans...
let tracing_filter = EnvFilter::default()
.add_directive(LevelFilter::ERROR.into())
.add_directive("[{number=1337}]=trace".parse().unwrap());
let _guard = tracing::span!(Level::INFO, "test", number = 1337).entered();
tracing::event!(Level::INFO, "hello");
_guard.exit();
let _guard = tracing::span!(Level::INFO, "test", number = 1437).entered();
tracing::event!(Level::INFO, "hello1");
_guard.exit();
Bug Report
Version
Platform
Windows 11 Enterprise(10.0.22631)
Description
It seems that when matching the contents of a field in a filter, the filter fails to work. When only matching the field name in the
working
function, the subscriber exhibits the expected behavior of no printed logs. When matching the contents of the fields in thebroken
function, the subscriber fails to filter out the two logs.The repro code is also available here in the
tracing-field-filter-bug
branch: https://github.com/wmmc88/minimal-repros/tree/tracing-field-filter-bug.Output:
I would have expected both tests to not print any of the 2 logs since the filter should set the level of those logs to
off
.