kubernetes/pkg/controller/nodelifecycle
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
..
config Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
scheduler Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
metrics.go adding evictions_total metric and marking evictions_number deprecated 2021-12-13 10:36:02 +08:00
node_lifecycle_controller_test.go move pkg/util/node to component-helpers/node/util (#105347) 2021-11-12 07:52:27 -08:00
node_lifecycle_controller.go avoid klog Info calls without verbosity 2022-01-12 07:48:36 +01:00
OWNERS Cleanup OWNERS files (No Activity in the last year) 2021-12-15 10:34:02 -05:00