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)

(cherry picked from commit a1617c7)
  • Loading branch information
kvch authored and mergify-bot committed Jan 7, 2022
1 parent 234393e commit 55127fa
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 55127fa

Please sign in to comment.