rust-lang / rust-lang/rust-analyzer

Assits: enable log statement

Open
#1,837 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-assists E-hard S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I use printf debugging a lot, and the problem with printfs is that you have to recompile the code, which is slow.

An alternative is to use loging, which can be configured at run time and does not need recompiling.

However, I find logs not very useful for debugging, as enabling logging is cumbersome, and you usually get way to much output.

Ideally, I'd love to be able to enable not only the whole log level, but specific log statements. I believe an IDE should help here:

  • for each log statement, there's an assist "enable log statement"
  • IDE maintains a persitent list of enabled log statemtnts
  • when running tasks, IDE set's RUST_LOG env variable to only hit the specified statements.

Contributor guide

Open the contributing guide

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 clarifying how IDE assists, persistent enabled log statements, and task environment configuration are represented. Check how running tasks currently handles the RUST_LOG environment variable; done should include an assist that selects individual log statements and applies those selections when tasks run.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
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.