Skip to content

Commit

Permalink
Improve deprecation comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Rebhan committed Dec 3, 2021
1 parent c662d26 commit 0c02235
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ func (c *Config) addInput(name string, table *ast.Table) error {

// Keep the old interface for backward compatibility
if t, ok := input.(parsers.ParserInput); ok {
// TODO: Issue deprecation warning using #9857
// DEPRECATED: Please switch your plugin to telegraf.ParserInput.
missThreshold = 1
if parser, err := c.addParser(name, table, true); err == nil {
t.SetParser(parser)
Expand Down Expand Up @@ -1285,7 +1285,7 @@ func (c *Config) addInput(name string, table *ast.Table) error {
}

if t, ok := input.(parsers.ParserFuncInput); ok {
// TODO: Issue deprecation warning using #9857
// DEPRECATED: Please switch your plugin to telegraf.ParserFuncInput.
missThreshold = 1
if parser, err := c.addParser(name, table, false); err == nil {
t.SetParserFunc(parser.GetParserFuncOld())
Expand Down
2 changes: 1 addition & 1 deletion plugins/parsers/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func NewParser(config *Config) (Parser, error) {
}

// Try to create new-style parsers the old way...
// TODO: Issue deprecation warning using #9857
// DEPRECATED: Please instantiate the parser directly instead of using this function.
parser = creator(config.MetricName)
p, ok := parser.(ParserCompatibility)
if !ok {
Expand Down

0 comments on commit 0c02235

Please sign in to comment.