Logging: Swap println/eprintln for a logging library
- Lingua principale
- Rust
- Stelle
- 2.3k
- Fork
- 230
- Merge medio
- 3g 3h
- PR unite (30g)
- 36
Descrizione
Currently, bootc uses the println and eprinln macros to log command progress. This makes it so that it is difficult to output structured output for programs to consume, as both 0 and 1 fds are used interchangeably for output, and to control the output logging level.
This is especially true for https://github.com/containers/bootc/pull/921 , as in its current stage it requires the `--json-fd=` param, which introduces an unsafe block and it will be especially difficult to consume from bash (requires opening a new descriptor and makes difficult to pipe).
Therefore, bootc should switch to a standard logging framework that pipes to stderr exclusively, and better yet through indicatif, so that both progress bars and structured output over stdout work correctly and universally.
If such change happens before https://github.com/containers/bootc/pull/921 is included in a release, `--json-fd=` can be dropped in favor of `--json` without introducing incompatibilities.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando la discussione dell'issue e containers/bootc#921 per comprendere i requisiti dell'output JSON e la gestione attuale dei descrittori di file. Individua quindi i punti di chiamata di println/eprintln e valuta il framework di logging e l'integrazione con indicatif. Il lavoro è completato quando i log di avanzamento usano stderr in modo coerente, mentre l'output strutturato rimane pulito su stdout senza richiedere --json-fd=.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- cli
- Tipo di issue
- Refactoring
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 28/100