Unconditional logging, or logging filtered by tag(s)
- Lingua principale
- C++
- Stelle
- 2.2k
- Fork
- 1.2k
- Merge medio
- 4g 11h
- PR unite (30g)
- 13
Descrizione
### Describe the feature
We need to be able to write messages to log files, no matter which value global logging level is set.
Or, as a better option, to be able to set a log filter, to allow for only messages matching specific tag(s) to be logged.
### Use Case
Here is the issue.
Logging level is set globally, so if I want to log a couple of warn messages from my code, I find log files polluted to the limit with tons (literally) of messages from other subsystems, like some HTTP threads logging "warnings" several times every millisecond:
```
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
...
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
```
### Proposed Solution
1. Add unconditional logging macro
2. Add logging filtering, a list of tags allowed (or not allowed) to log, or, a better solution, an optional bool function, accepting a tag, passed to logging macro.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Non vengono indicati file, test o punti di ingresso. Inizia individuando le macro di logging dell'SDK e la configurazione globale del livello di logging, quindi determina come il logging incondizionato o il filtraggio basato sui tag debbano interagire con il comportamento esistente; il lavoro è completo quando il filtraggio o bypass richiesto è implementato con una semantica documentata e testata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- observability-sre
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100