Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yotamofek
Copy link
Contributor

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.

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 18, 2025
Copy link
Member

@compiler-errors compiler-errors left a 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",);
Copy link
Member

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.

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants