canonical / canonical/craft-cli
Don't add timestamps when the subprocess already does that
- Dominant language
- Python
- Stars
- 16
- Forks
- 27
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 10
Description
We need to add a flag to `emit.open_stream`, something like `sub_with_timestamps` (defaults to `False`), which would mean that the executed stuff will add its own timestamp, so in that case Craft CLI won't add the timestamp to the message
This way, if we use emit.open_stream on something that has it's own Craft CLI stuff (or adds timestamps in some way), the outer timestamp will not be present; but if we run whatever (e.g. pip) it will add the timestamps as currently does.
Contributor guide
Research direction
Start at the `emit.open_stream` entry point and trace where subprocess output receives timestamps. Verify how existing callers use the stream, then implement the requested opt-out behavior while preserving timestamps for ordinary commands. Done means subprocesses that provide their own timestamps are not double-timestamped, while commands such as `pip` retain the current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100