Commit Graph

5 Commits

Author SHA1 Message Date
Georgi Dimitrov 4ea4861398 Add a DeferExitHandler function
Useful for running exit handlers in the same order as defer statements
2019-01-29 10:29:38 -08:00
Aaron.L.Xu 169c157a10 fix dead url for alt_exit.go 2017-02-08 19:18:14 +08:00
Aaron Greenlee a283a10442 Improved documentation of Fatal Handlers 2016-07-15 22:56:31 -04:00
Aaron Greenlee ff52e76f67 Go fmt alt exit addition 2016-06-24 10:24:56 -04:00
Aaron Greenlee a7755c5c03 Enhanced fatal calls so exit handlers can be invoked
While GO offers the ability to recover from panic there is no way to intercept an os.Exit event. To allow graceful shutdown and clean-up or programs which use Logrus to Fatal out I've borrowed ideas from the `atexit` package and enhanced Logrus.

Usage:
* When setting up the logger one call `RegisterExitHandler( func() {...} )` to add a handler that will be invoked for any `Fatal` call to the logger.
2016-06-24 10:23:56 -04:00