kubernetes/pkg/kubelet/eviction
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
..
api Merge pull request #97493 from Pingan2017/allocatemem-1224 2021-03-07 20:09:44 -08:00
doc.go
eviction_manager_test.go Merge pull request #104933 from vikramcse/automate_mockery 2021-09-30 18:33:21 -07:00
eviction_manager.go fix: typo 2021-11-17 09:22:57 +08:00
helpers_test.go Add test cases to the addAllocatableThresholds function in pkg/kubelet/eviction/helpers.go 2021-06-15 11:32:44 +00:00
helpers.go avoid klog Info calls without verbosity 2022-01-12 07:48:36 +01:00
memory_threshold_notifier_test.go mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
memory_threshold_notifier.go Structured Logging migration: modify eviction part logs of kubelet. 2021-02-21 08:36:14 +08:00
mock_threshold_notifier_test.go mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
threshold_notifier_linux.go kubelet: cgroupv2 disable memcg notifications 2021-11-10 15:40:59 -08:00
threshold_notifier_unsupported.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
types.go mockery to mockgen conversion 2021-09-25 16:15:08 +00:00