From 06dd2d1fbe2c6a43ee7a6b9f87178c58d2feb9a4 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 1 Jul 2020 17:41:15 -0400 Subject: [PATCH 1/3] Deprecate typo-ed Structured logging method (Error->ErrorS) Signed-off-by: Davanum Srinivas --- klog.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/klog.go b/klog.go index ae2b86138..e91e045e4 100644 --- a/klog.go +++ b/klog.go @@ -1324,14 +1324,21 @@ func (v Verbose) InfoS(msg string, keysAndValues ...interface{}) { } } -// Error is equivalent to the global Error function, guarded by the value of v. -// See the documentation of V for usage. +// Deprecated: Use ErrorS instead. func (v Verbose) Error(err error, msg string, args ...interface{}) { if v.enabled { logging.errorS(err, v.logr, msg, args...) } } +// ErrorS is equivalent to the global Error function, guarded by the value of v. +// See the documentation of V for usage. +func (v Verbose) ErrorS(err error, msg string, args ...interface{}) { + if v.enabled { + logging.errorS(err, v.logr, msg, args...) + } +} + // Info logs to the INFO log. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Info(args ...interface{}) { From aa26aeb301df227eba8909032c267c776fdb8a04 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 2 Jul 2020 09:45:23 -0400 Subject: [PATCH 2/3] Update klog.go Co-authored-by: Marek Siarkowicz --- klog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klog.go b/klog.go index e91e045e4..593ab7993 100644 --- a/klog.go +++ b/klog.go @@ -1333,7 +1333,7 @@ func (v Verbose) Error(err error, msg string, args ...interface{}) { // ErrorS is equivalent to the global Error function, guarded by the value of v. // See the documentation of V for usage. -func (v Verbose) ErrorS(err error, msg string, args ...interface{}) { +func (v Verbose) ErrorS(err error, msg string, keysAndValues ...interface{}) { if v.enabled { logging.errorS(err, v.logr, msg, args...) } From 55c60a64d9441eaec875bf12cf4702f6edfacc8c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 2 Jul 2020 09:45:30 -0400 Subject: [PATCH 3/3] Update klog.go Co-authored-by: Marek Siarkowicz --- klog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klog.go b/klog.go index 593ab7993..49f1f2dd2 100644 --- a/klog.go +++ b/klog.go @@ -1335,7 +1335,7 @@ func (v Verbose) Error(err error, msg string, args ...interface{}) { // See the documentation of V for usage. func (v Verbose) ErrorS(err error, msg string, keysAndValues ...interface{}) { if v.enabled { - logging.errorS(err, v.logr, msg, args...) + logging.errorS(err, v.logr, msg, keysAndValues...) } }