Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust telegraf.Logger to be easy to use in whole codebase #10212

Closed
zak-pawel opened this issue Dec 3, 2021 · 1 comment · Fixed by #15234
Closed

Adjust telegraf.Logger to be easy to use in whole codebase #10212

zak-pawel opened this issue Dec 3, 2021 · 1 comment · Fixed by #15234
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@zak-pawel
Copy link
Collaborator

Feature Request

@zak-pawel zak-pawel added the feature request Requests for new plugin and for new features to existing plugins label Dec 3, 2021
@srebhan
Copy link
Member

srebhan commented Dec 3, 2021

I think all that is needed is to move the logging facility out of models to avoid circular dependencies. Then you can just do

import "github.com/influxdata/telegraf/logger"

var log = logger.New("mycategory", "mymodule", "myalias")

log.Warnf("This might go wrong...")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants