Skip to content

Commit f330585

Browse files
authored
Merge pull request #5492 from vorburger/patch-1
update logging guideline re. shared libraries
2 parents 85b699b + befaff0 commit f330585

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contributors/devel/sig-instrumentation/logging.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ The following conventions for the klog levels to use.
44
[klog](http://godoc.org/github.com/kubernetes/klog) is globally preferred to
55
[log](http://golang.org/pkg/log/) for better runtime control.
66

7+
Shared libraries, such as `client-go`, should not use `klog.Errorf()` and `klog.Warningf()`,
8+
but just return `error`, because client libraries may be used in CLI UIs that wish to control output.
9+
710
* klog.Errorf() - Always an error
811

912
* klog.Warningf() - Something unexpected, but probably not an error

0 commit comments

Comments
 (0)