summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vorburger ⛑️ <mike@vorburger.ch>2021-02-12 19:01:13 +0100
committerMichael Vorburger <mike@vorburger.ch>2021-02-12 19:06:54 +0100
commitbefaff0f8ffe2c9651ca96cecbaf5c0c0f166658 (patch)
treebd050a707369cd682b50b7ff00a3fc4105094977
parent1f4f5d38d68db2093a299c058e9f189a0e81f5be (diff)
Update logging guideline re. shared libraries
-rw-r--r--contributors/devel/sig-instrumentation/logging.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/contributors/devel/sig-instrumentation/logging.md b/contributors/devel/sig-instrumentation/logging.md
index d7e052c0..0f3fa7de 100644
--- a/contributors/devel/sig-instrumentation/logging.md
+++ b/contributors/devel/sig-instrumentation/logging.md
@@ -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