-
Notifications
You must be signed in to change notification settings - Fork 208
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
logging: remove global logger #4751
Labels
Comments
7 tasks
bors bot
pushed a commit
that referenced
this issue
Aug 1, 2023
## Motivation Using a global logger makes testing harder and logging configuration more complicated. This PR removes most uses of the global logger to address this. ## Changes - Instead of the global logger services now use their own logging instance, this should reduce the number of log lines produced by `0000.defaultLogger` - There are still a few places where the global logger is used, primarily the `common/types` package where it cannot be replaced without some bigger changes. Issue for this: #4751 ## Test Plan n/a ## TODO <!-- This section should be removed when all items are complete --> - [x] Explain motivation or link existing issue(s) - [x] Test changes and document test plan - [x] Update documentation as needed ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
After #4749 there are still some parts in go-spacemesh left that use the global logger instead of a service-specific one. This makes testing & configuration of those logs more difficult.
Affected code
Specifically the following packages still use the global logger in some places:
events
common/types
hare
grpcserver
Todo:
package events
The logger in those packages is used in functions that are not part of a service and thereby do not yet have a logger thats injected into them. Consider removing them by one of the following:
The text was updated successfully, but these errors were encountered: