Skip to content

Commit

Permalink
Merge pull request #170 from dims/deprecate-typo-ed-structured-loggin…
Browse files Browse the repository at this point in the history
…g-method

Deprecate typo-ed Structured logging method (Error->ErrorS)
  • Loading branch information
k8s-ci-robot committed Jul 2, 2020
2 parents d738e55 + 55c60a6 commit b5c3182
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions klog.go
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, keysAndValues ...interface{}) {
if v.enabled {
logging.errorS(err, v.logr, msg, keysAndValues...)
}
}

// 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 b5c3182

Please sign in to comment.