gemnasium / logrus-graylog-hook

Graylog hook for logrus
MIT License
87 stars 63 forks source link

Update README.md with some details on flush #57

Closed nphilbrook closed 1 year ago

nphilbrook commented 1 year ago

While using this library, I noticed 2 spots in my employer's code where this defer hook.Flush() code was copied verbatim into a non-main() method, completely negating the effect, since the Flush method would only be called at the end of method being used to set up the hook, NOT before the end of program's execution.

This PR attempts to clarify without being overly verbose, open to feedback.

Thanks for providing this library!

gravis commented 1 year ago

Hi @nphilbrook, thanks for this contribution. I thought it was obvious, but it's better to be explicit about this, good catch!

nphilbrook commented 1 year ago

Hi @nphilbrook, thanks for this contribution. I thought it was obvious, but it's better to be explicit about this, good catch!

You're welcome! You'd think it would be obvious...but you know how engineers love to copy and paste without thinking critically :D

Hopefully the comment will help someone in the future.