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) (#29739)

(cherry picked from commit a1617c7)

Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
  • Loading branch information
mergify[bot] and kvch committed Jan 10, 2022
1 parent aeb6bbc commit faf6fbf
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 faf6fbf

Please sign in to comment.