fix: fatal logger notification

This commit is contained in:
Jonas Kaninda
2024-12-06 21:00:26 +01:00
parent d5a0adc981
commit d8c73560b8

View File

@@ -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)
}