kubernetes/pkg/kubelet/status
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
..
testing mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
generate_test.go Generate ContainersReady condition 2018-06-05 11:10:38 -07:00
generate.go Fix golint failures of pkg/kubelet/status/... 2019-09-21 23:43:37 +08:00
status_manager_test.go Do not sync Waiting statuses for Terminated pods 2021-10-04 11:05:54 -07:00
status_manager.go avoid klog Info calls without verbosity 2022-01-12 07:48:36 +01:00