From 12f9efded7c05ef1ca51b60df759afdcacc6d91f Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Mon, 1 Mar 2021 13:46:22 +0100 Subject: [PATCH] bugfix: d2util.Logger.Fatal() didn't return any value, when d2util.Logger.level < LogLevelFatal --- d2common/d2util/logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d2common/d2util/logger.go b/d2common/d2util/logger.go index e705a88f..83a212a9 100644 --- a/d2common/d2util/logger.go +++ b/d2common/d2util/logger.go @@ -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