Merge pull request #1082 from gucio321/hotfix

bugfix: d2util.Logger.Fatal()
This commit is contained in:
gravestench 2021-03-11 22:17:51 -08:00 committed by GitHub
commit 97516d5da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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