feat: Implement colored output (with `NO_COLOR` support)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Inizia in rust/stackablectl/src/main.rs intorno al metodo pretty indicato e confronta se tracing_subscriber::fmt debba occuparsi del rilevamento del terminale. Esegui i comandi stackablectl elencati con l’output reindirizzato e convogliato tramite pipe, incluso con un TERM vuoto, e conferma che l’output non interattivo non contenga sequenze di escape, mentre l’output dei terminali supportati rimanga colorato e NO_COLOR venga rispettato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Colours sould only be enabled when the terminal supports them.
For example, when redirecting output or piping to cat, there should be no escape sequences.
I believe there needs to be a condition around the pretty method (or maybe it should be handled by tracing_subscriber::fmt):
Examples:
stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # plain redirect
stackablectl --log-level=DEBUG stack list | cat > /tmp/stackablectl.stdout # pipe through cat
TERM= stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # explicitly set TERM to nothing
If I open it in VIM, it looks like this:
- Lingua principale
- Rust
- Stelle
- 10
- Fork
- 5
- Merge medio
- 4h 41m
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stackabletech/stackablectl
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stackabletech/stackablectl#456 ·
-
RUSTSEC-2026-0221: `event-listener` allows `!Send` tags to cross thread boundaries via `StackSlot` Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
stackabletech/stackablectl#452 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
stackabletech/stackablectl#444 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
stackabletech/stackablectl#419 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
stackabletech/stackablectl#413 ·