From d8c73560b860f3b0b14ee174f4b54f31ac512a08 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Fri, 6 Dec 2024 21:00:26 +0100 Subject: [PATCH] fix: fatal logger notification --- utils/logger.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/logger.go b/utils/logger.go index 045cee3..ac7b2de 100644 --- a/utils/logger.go +++ b/utils/logger.go @@ -54,7 +54,13 @@ func Error(msg string, args ...interface{}) { func Fatal(msg string, args ...interface{}) { log.SetOutput(os.Stdout) + // Format message if there are additional arguments + formattedMessage := msg + if len(args) > 0 { + formattedMessage = fmt.Sprintf(msg, args...) + } logWithCaller("ERROR", msg, args...) + NotifyError(formattedMessage) os.Exit(1) }