sirupsen / logrus

Structured, pluggable logging for Go.
MIT License
24.76k stars 2.27k forks source link

Testing logrus.Fatal with default logger #1374

Closed felipe-colussi closed 1 year ago

felipe-colussi commented 1 year ago

The issue #813 was fixed and allowed tests .Fatal() with custom loggers.

That said the ExitFunction can be changed only if you instanciate a logger. If you use the "default Logger" you cant change that (the "default logger" ain't exported so I cant just overwrite the exit function). This make testing functions that can call the logrus.Fatal() kinda tricky.

Would be possible to create and export a Setter for the Logger? If you are accepting PRs I don't mind creating one.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.