kubernetes/pkg/kubelet/pleg
Patrick Ohly 9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
..
doc.go
generic_test.go Merge pull request #104933 from vikramcse/automate_mockery 2021-09-30 18:33:21 -07:00
generic.go avoid klog Info calls without verbosity 2022-01-12 07:48:36 +01:00
pleg.go fix golint failures - /pkg/kubelet/images 2018-09-17 10:52:25 +08:00