-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_resolve: use structured fields in traces #135676
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(don't make another commit, just amend the existing one).
"find_span_immediately_after_crate_name: module_name={:?} use_span={:?}", | ||
module_name, use_span | ||
); | ||
debug!("find_span_immediately_after_crate_name",); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no need to repeat the name of the function here and elsewhere; please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think should be the message instead? Something like debug!("entered")
?
(in the places where fields are added I can just remove the message)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not totally certain that they're even adding much value to keep around at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed those, then. (and the instrumentation for the containing fns)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the instrument
annotation. #[instrument(level = "debug", skip(...))]
should "just work" without any dummy debug!
statement in the body shouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're absolutely right. I thought it only created spans but no "enter" event. I was also creating info
-level spans by accident. Fixed.
a70ca63
to
5f1bf88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path
has since been mutated so its not redundant with the #[instrument
debug on the function
5f1bf88
to
539b4d8
Compare
Oh, right, thanks! Fixed. (in two other places too) |
I think this crate was written before
tracing
was adopted, and was manually writing fields into trace logs instead of using structured fields.I kept function names in the trace messages even though I added
#[instrument]
invocations so that the events will be in named spans, wasn't sure if spans are always printed.