rust-cli / rust-cli/env_logger

Logging levels to different outputs

Open
#364 11 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.1k
Forks
149
Avg merge
2h 42m
Merged PRs (30d)
4

Description

I think it'd be a useful addition to allow logging different logging levels to different outputs. If this is already possible, please excuse my inability to search issues or read documentation or read code. Especially the last.

Self deprication aside, it's currently hardcoded what targets can be used with env_logger. The current issue I'm facing is the following:

  • I log info logs
  • I log error logs
  • Both go to stderr, stdout or a pipe I guess

I don't like that, I'd prefer logging info to stdout and error to stderr. That should be relatively simple with a Mixed target or smtg, and implementing the different targets seperately instead of matching an enum. That'd even open up the possibility for custom targets!

Do I dream too big? Yes. But!

Okay, yes.

Thanks, hope this sparks some ideas, I'm sorry for being so casual k thx bye <3

(also, letting me implement it is a bad idea I cannot do the rust well)

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 reading env_logger's current hardcoded target handling and the discussion around issue #364. Determine how a Mixed target, per-level routing, and custom targets would fit the existing target and enum design. Done means the behavior and API are agreed on and routing such as info to stdout and error to stderr is implemented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.