Update logging guideline re. shared libraries

This commit is contained in:
Michael Vorburger ⛑️ 2021-02-12 19:01:13 +01:00 committed by Michael Vorburger
parent 1f4f5d38d6
commit befaff0f8f
No known key found for this signature in database
GPG Key ID: 56FF746E772681EB
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,9 @@ The following conventions for the klog levels to use.
[klog](http://godoc.org/github.com/kubernetes/klog) is globally preferred to
[log](http://golang.org/pkg/log/) for better runtime control.
Shared libraries, such as `client-go`, should not use `klog.Errorf()` and `klog.Warningf()`,
but just return `error`, because client libraries may be used in CLI UIs that wish to control output.
* klog.Errorf() - Always an error
* klog.Warningf() - Something unexpected, but probably not an error