Skip to content

Commit

Permalink
Deprecate typo-ed Structured logging method (Error->ErrorS)
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Jul 1, 2020
1 parent d738e55 commit 06dd2d1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions klog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}) {
Expand Down

0 comments on commit 06dd2d1

Please sign in to comment.