apex / apex/log

Lazy fields

Offen
#37 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
1.4k
Forks
110
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.