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

shim logger improvements #7865

Merged
merged 2 commits into from
Jul 22, 2020
Merged

shim logger improvements #7865

merged 2 commits into from
Jul 22, 2020

Conversation

ssoroka
Copy link
Contributor

@ssoroka ssoroka commented Jul 20, 2020

  • warn on loading default config
  • move stdin reader to a goroutine so it doesn't block forever on local ctrl-c shutdown
  • add shim logger interface that writes to stderr by default to work well with the shim environment.
  • set Log telegraf.Logger if it's defined on plugins before calling plugin.Init() to avoid panics from plugins that expect to use it.
  • add deprecation warning about using old shim.

}

// setLoggerOnPlugin used to be called setLogIfExist
func setLoggerOnPlugin(i interface{}, log telegraf.Logger) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why rename this when it's copied verbatim from models/log.go? I don't particularly like the name setLogIfExist but it should match models/log.go. If you're going to rename it, change both places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this suggestion.

@ssoroka ssoroka requested a review from reimda July 22, 2020 16:48
@danielnelson danielnelson added this to the 1.15.0 milestone Jul 22, 2020
@ssoroka ssoroka merged commit 569584d into master Jul 22, 2020
@ssoroka ssoroka deleted the shims branch July 22, 2020 18:29
ssoroka added a commit that referenced this pull request Jul 22, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants