-
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
Remove global logging functions in libbeat #15699
Labels
Comments
This was referenced Jan 21, 2020
This was referenced Jan 29, 2020
2 tasks
urso
changed the title
Remove global logging functions
Remove global logging functions in libbeat
Feb 14, 2020
2 tasks
This was referenced Feb 26, 2020
simitt
added a commit
to simitt/beats
that referenced
this issue
Mar 3, 2020
3 tasks
simitt
added a commit
that referenced
this issue
Mar 5, 2020
5 tasks
andresrc
added
Team:Integrations
Label for the Integrations team
and removed
Team:Beats
labels
Mar 6, 2020
This was referenced Mar 6, 2020
simitt
added a commit
to simitt/beats
that referenced
this issue
Mar 24, 2020
4 tasks
This was referenced May 14, 2020
6 tasks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing for now as all tasks listed were achieved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to better support structured logging, we want to get rid of the global logger functions. The API of the global logger functions is not in line with the methods defined by
(*logp).Logger
.For now we will focus on libbeat first.
Refactoring Notes/Tips:
logp.Debug/Info/Warn/...
withf
variants like(*Logger).Debugf/Infof/Warnf/...
if a format string has been used. Otherwise stick with(*Logger).Debug/Info/...
%+v
when logging an error using a format string. Some logger libraries implement fmt.Formatter and will print the wrapped error only if+
is given.logp.Debug
accepts as first argument theselector
name.*logp.Logger
instances have a name and the selector name must be removed when switching to(*Logger).Debugf
(*Logger).Named
(prefer(*Logger).Named
) to create a logger instance in order to replace logp.MakeDebug. For now in unit tests you can uselogp.L()
if you need to pass a logger you don't care aboutlogp.NewLogger
to reduce the amount of transitive changes.NewLogger
will be removed in the future as well, but for now it can help to reduce PR sizes.tags=nologpglobal
to compile/test a package without logp global logging functions being availableTasks
The text was updated successfully, but these errors were encountered: