uber-go/fx

fxevent.Logger: Silence until there's an error

Opened this issue · 0 comments

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