rust-lang / rust-lang/rustc-dev-guide

Add logging in rustc itself that links to the dev-guide

Open
#949 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion
Dominant language
HTML
Stars
1.9k
Forks
613
Avg merge
17h 24m
Merged PRs (30d)
39

Description

It would really cool if, among the myriad other logging in rustc, we could also have 'dev-guide logging'. The idea is that you could have RUSTC_LOG=[rustc_dev_guide]=info, which shows logging from all crates that has a rustc_dev_guide span. I'm imagining something like this:

$ RUSTC_LOG=[rustc_dev_guide]=info rustc x.rs
INFO rustc_query_system[rustc_dev_guide] See https://rustc-dev-guide.rust-lang.org/query.html for more information about queries
INFO rustc_metadata[rustc_dev_guide] See https://rustc-dev-guide.rust-lang.org/serialization.html for more information about serialization in rustc

cc @hawkw - do you know if it's currently possible to have a span without a target? I'd hate to have to specify all 50 rustc_* crates by hand.
cc @igaray - I think you said you had a partial prototype for this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed RUSTC_LOG command and the linked tracing-subscriber EnvFilter documentation. Determine how rustc crates could expose dev-guide spans and which guide pages should be linked; done means the requested filter produces useful logs across relevant crates.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.