-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[libbeat] Remove global loggers from libbbeat/dashboard #18541
[libbeat] Remove global loggers from libbbeat/dashboard #18541
Conversation
Pinging @elastic/integrations (Team:Integrations) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
libbeat/dashboards/kibana_loader.go
Outdated
@@ -153,6 +157,6 @@ func (loader KibanaLoader) statusMsg(msg string, a ...interface{}) { | |||
if loader.msgOutputter != nil { | |||
loader.msgOutputter(msg, a...) | |||
} else { | |||
logp.Debug("dashboards", msg, a...) | |||
loader.defaultLogger.Debugf("%s %v", msg, a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old implementation looks like "statusMsg" implements a Printf like interface (better named would have been statusMsgf
.
s/loader.defaultLogger.Debugf("%s %v", msg, a)/loader.defaultLogger.debugf(msg, a...)/
Is MsgOutputer used somewhere? It kind of looks like a 'duplicate' interface for logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, it was one of those things where whatever calls the loader also asks for that message handler option, so it seems to go fairly high up the call stack and I was hesitant to mess with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Let's change this line to this (to restore the behavior from before this PR):
loader.defaultLogger.Debugf(msg, a...)
What does this PR do?
See #18500 for the meta-issue. This remove any global loggers. I was a tad hesitant to turn "soft" errors into hard errors, so I worked around some of the error handling for the sake of not breaking anything. This still technically contains "breaking" changes, so not sure if we wanna backport it.
Why is it important?
We want to remove the global logger from libbeat.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.