Skip to content

Commit

Permalink
Do not mention removal if version is not specified in cfgwarn messa…
Browse files Browse the repository at this point in the history
…ges (#29727)
  • Loading branch information
kvch committed Jan 7, 2022
1 parent 6531ae6 commit a1617c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libbeat/common/cfgwarn/cfgwarn.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ func Beta(format string, v ...interface{}) {
}

// Deprecate logs a deprecation message.
// The version string contains the version when the future will be removed
// The version string contains the version when the future will be removed.
// If version is empty, the message will not mention the removal of the feature.
func Deprecate(version string, format string, v ...interface{}) {
postfix := fmt.Sprintf(" Will be removed in version: %s", version)
var postfix string
if version != "" {
postfix = fmt.Sprintf(" Will be removed in version: %s", version)
}
logp.NewLogger(selector, zap.AddCallerSkip(1)).Warnf("DEPRECATED: "+format+postfix, v...)
}

Expand Down

0 comments on commit a1617c7

Please sign in to comment.