Comments (7)
Oh I noticed that it's really only the hyper::proto::h1::role
module that gets through. All other hyper logs, and there's many at trace level, get filtered.
from fern.
Interesting! It looks like that's the only module in hyper which uses tracing
's trace_span!
macro. I wonder if there's something different about the way tracing is including the module path in the span!
and trace_span!
macros.
If you're still actively debugging this, it might be interesting to include the module_path with the {:?}
debug printing and see if there's any weird characters in there?
Fern's module matching logic is at
Line 250 in fab151f
split
, but its code is at least moderately unit-tested and should behave similarly.
It may take me a few days to find the time to look into this further, so any further debugging you can do conveniently would be much appreciated!
from fern.
It doesn't look different. (I allowed some other modules to get an example:)
[2021-10-15 13:52:44.109][TRACE]["want"] signal: Want
[2021-10-15 13:52:44.110][TRACE]["hyper::proto::h1::role"] encode_headers
[2021-10-15 13:52:44.110][TRACE]["hyper::proto::h1::role"] -> encode_headers
[2021-10-15 13:52:44.110][TRACE]["hyper::proto::h1::role"] <- encode_headers
[2021-10-15 13:52:44.110][TRACE]["hyper::proto::h1::role"] -- encode_headers
[2021-10-15 13:52:44.110][TRACE]["want"] signal: Want
[2021-10-15 13:52:44.110][TRACE]["mio::poll"] deregistering event source from poller
The Debug
format adds the quotes, but nothing more it seems.
from fern.
Aha, I found something!
When I replace the module
with record.metadata().target()
, it prints this:
[2021-10-15 13:57:47.313][TRACE][tracing::span] encode_headers
[2021-10-15 13:57:47.313][TRACE][tracing::span::active] -> encode_headers
[2021-10-15 13:57:47.313][TRACE][tracing::span::active] <- encode_headers
[2021-10-15 13:57:47.313][TRACE][tracing::span] -- encode_headers
[2021-10-15 13:57:47.319][TRACE][tracing::span] parse_headers
[2021-10-15 13:57:47.319][TRACE][tracing::span::active] -> parse_headers
[2021-10-15 13:57:47.320][TRACE][tracing::span::active] <- parse_headers
[2021-10-15 13:57:47.320][TRACE][tracing::span] -- parse_headers
[2021-10-15 13:57:47.321][TRACE][tracing::span] encode_headers
[2021-10-15 13:57:47.321][TRACE][tracing::span::active] -> encode_headers
[2021-10-15 13:57:47.321][TRACE][tracing::span::active] <- encode_headers
[2021-10-15 13:57:47.322][TRACE][tracing::span] -- encode_headers
So somehow, fern
finds that the module is hyper
, but the target that is used for filtering is tracing
.
from fern.
Ah! Interesting. That would explain the difference.
I would need to do more investigation, but I'm leaning towards this possibly being a bug in tracing right now, then? I think the log "target" is really what we should filter on as a log backend, rather than the module path, and it seems like a bug that calls from hyper would end up in the tracing log target. But maybe this is intentional? I have not followed what tracing has been doing for a while.
from fern.
I think this code in tracing
is causing this:
If there are no attributes associated with a span, then it creates a log record with the target "tracing::span"
rather than the target specified by the span's metadata.
Specifically, this call to trace_span!("parse_headers")
:
Calls into this:
Which calls here:
Line 73 of that calls Span::new(meta, valueset!(meta.fields(),))
. But, meta.fields()
is empty because it was created with CALLSITE.metadata()
, and that CALLSITE
's fields were just populated with $(fields)*
, of which none were given.
So we end up at
with values
being empty. This goes to
still, with empty values
. Finally, we get to Span::make_with
with an empty new_span
parameter:
This, for some reason, then decides that since we haven't supplied any attributes, we should get the default log target.
Now... I've still got no idea whether or not this is a bug, or intended. I don't know tracing's design philosophy. But this should at least be a good start for talking to tracing about whether this is correct?
from fern.
I think this is tracing
's issue here - as far as I can tell, fern is correct to use target
when filtering like this.
I've filed a new feature issue in fern for separate filtering based on modules, not targets, here: #109
However, I do view that as a feature, not a bug, and I believe tracing is incorrect in its behavior with regards to this issue.
from fern.
Related Issues (20)
- WithFgColor doesn't match colored::Colorize's behavior
- `level_for_module` level-filtering for modules, not targets HOT 3
- Doc type: "equivalent form another crate"
- is there anyway to disable all crates log and only show log of my program? HOT 2
- Connection forcibly closed using `TcpStream` as `Box<dyn Write + Send>` HOT 2
- Getting rid of `atty` as a transitive dependency (via `colored`) HOT 25
- `SharedDispatch` type is not accessible HOT 2
- Missing list of dependancies in example HOT 2
- Syslog only logs in UTC HOT 2
- Reading from Box not possible since fern::Output::writer consumes it? HOT 2
- DateBased struct not accessible
- double free or corruption (out) HOT 1
- Feature Request: Log string configuration
- Implement log::kv Handling
- Colors and Emojis seem to break rending in Bash and Yakuake HOT 2
- switch from chrono to time HOT 2
- Different formats for differen logging targets? HOT 1
- Possible to chain more files after already intializing a logger?
- Top-level documentation suggests using 0.5 instead of 0.6 HOT 1
- Add new Linux CI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fern.