envoyproxy/envoy

Fine grained logging via FANCY_LOG always evaluates macro arguments

Open

#12.885 aperta il 29 ago 2020

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)C++ (5373 fork)batch import
area/envoy_loghelp wanted

Metriche repository

Star
 (27.997 star)
Metriche merge PR
 (Merge medio 8g) (378 PR mergiate in 30 g)

Descrizione

The ENVOY_LOG macro without fine grained logging doesn't evaluate variadic arguments when the log level squelches the message. When going through FANCY_LOG however, that no longer holds. Variadic arguments are always evaluated regardless of the log level involved. This could be problematic from a perf point of view.

Context: https://github.com/envoyproxy/envoy/pull/12830#issuecomment-681918730

Guida contributor