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

fxevent.Logger: Silence until there's an error #1167

Open
abhinav opened this issue Feb 23, 2024 · 0 comments
Open

fxevent.Logger: Silence until there's an error #1167

abhinav opened this issue Feb 23, 2024 · 0 comments

Comments

@abhinav
Copy link
Collaborator

abhinav commented Feb 23, 2024

Is your feature request related to a problem? Please describe.
The Fx event log is useful in debugging startup failures when there's a failure.
However, in the success case, it's largely noise.

Describe the solution you'd like
A variant of fxevent.Logger that prints nothing if the service successfully starts up, but prints the full event log if there were any failures in the process.

This would probably take the form of a wrapper around fxevent.Logger that buffers messages in-memory, and flushes them if any of the individual error-able events fails, or if the entire start up fails.

I haven't thought about what the API for this would look like.

Describe alternatives you've considered

  • Live with it and ignore the hundreds of lines of meaningless logs
  • Disable the fxevent logger and lose the ability to debug

Is this a breaking change?
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants