bugfix: d2util.Logger.Fatal() didn't return any value, when d2util.Logger.level < LogLevelFatal

This commit is contained in:
M. Sz 2021-03-01 13:46:22 +01:00
parent fa4276156c
commit 12f9efded7
1 changed files with 2 additions and 1 deletions

View File

@ -136,12 +136,13 @@ func (l *Logger) Errorf(fmtMsg string, args ...interface{}) {
// Fatal logs an fatal error message and exits programm
func (l *Logger) Fatal(msg string) {
defer os.Exit(1)
if l == nil || l.level < LogLevelFatal {
return
}
l.print(LogLevelFatal, msg)
os.Exit(1)
}
// Fatalf formats and then logs a error message