rust-cli / rust-cli/env_logger

Changing the target of logging

Open
#369 0 comments 0 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

We have an application that runs in multiple batches where inputs and outputs of a given batch have their own directory batchX. It would be useful if the log file were also inside this directory which requires changing the target at runtime. We currently do this by defining a custom type with internal locking to impl Write on and then initialize it as static to satisfy 'static lifetime of Target::Pipe, which seems a bit awkward.

Is there a better way to accommodate this?

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 the Target::Pipe API and the runtime initialization approach described in the issue, focusing on its 'static lifetime requirement and how output targets are selected. Determine the supported design for changing a log target between batches; done means the approach is defined clearly and, if accepted, works without a custom statically initialized writer.

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.