envoyproxy/envoy

Fine grained logging via FANCY_LOG always evaluates macro arguments

Open

#12,885 opened on 2020年8月29日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)C++ (5,373 forks)batch import
area/envoy_loghelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (平均マージ 8d) (30d で 378 merged PRs)

説明

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

コントリビューターガイド