rust-cli / rust-cli/env_logger
Hiding module path but displaying target
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 149
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
Hi!
I'm currently stuck at configuring the logger. By default, if I write the following code:
// module: example
error!("YOH");
error!(target: "a", "YOH");
It will display:
[2022-10-19T11:08:47Z INFO onix_server] YOH
[2022-10-19T11:08:47Z INFO a] YOH
What I'd like to see is:
[2022-10-19T11:08:47Z INFO ] YOH
[2022-10-19T11:08:47Z INFO a] YOH
Which means not displaying the module the log comes from, but displaying the custom target if any is provided.
How can I achieve that? I use .format_module_path(false) but it seemed to have no effect.
Thanks in advance for your help!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the format_module_path(false) configuration and the logger formatting behavior described in the issue. Confirm why disabling the module path has no effect, then verify that the module path is omitted while an explicitly provided target such as "a" remains visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100