apex / apex/log

Lazy fields

Aperta
#37 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
1.4k
Fork
110
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It would be nice to have an optional ``WithLazyFields(key string, func() interface{})`` method to calculate field value only when it's retrieved with ``Get(key string)`` method.

I.e. some entries may be discarded due to log level, but they are still evaluated.

A real life example is dumping http requests/responses on debug level. It requires much more memory for each request to process, and it's painful to have some debug switches to turn it on/off on local/production system.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.