Add a method Exit on Logger that calls os.Exit or alternate exit function.

This keeps backward compatibility for static declaration of logger
that does not specify `ExitFunc` field.
This commit is contained in:
Albert Salim
2018-10-10 21:54:15 +08:00
parent 2be620216a
commit 99bc300c8d
5 changed files with 26 additions and 25 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ const (
// PanicLevel level, highest level of severity. Logs and then calls panic with the
// message passed to Debug, Info, ...
PanicLevel Level = iota
// FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the
// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
// logging level is set to Panic.
FatalLevel
// ErrorLevel level. Logs. Used for errors that should definitely be noted.