summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>2021-02-24 09:24:50 -0800
committerGitHub <noreply@github.com>2021-02-24 09:24:50 -0800
commitf3305857e79a74bdf7d9d717ffc028498615c50f (patch)
tree49faee5286bbc2ce34d6a9504ee987295eccdf5a
parent85b699b991b0e8a6bbf76d062900e96147109e4d (diff)
parentbefaff0f8ffe2c9651ca96cecbaf5c0c0f166658 (diff)
Merge pull request #5492 from vorburger/patch-1
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