From befaff0f8ffe2c9651ca96cecbaf5c0c0f166658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Fri, 12 Feb 2021 19:01:13 +0100 Subject: Update logging guideline re. shared libraries --- contributors/devel/sig-instrumentation/logging.md | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3