Skip to content

Commit 40408a4

Browse files
committed
Add Fatalf method
1 parent 7a13cd7 commit 40408a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

logging.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ func (l *Logger) Fatal(msg string) {
9494
os.Exit(1)
9595
}
9696

97+
func (l *Logger) Fatalf(msg string, a ...any) {
98+
l.doLog(slog.LevelError, msg, a...) //nolint:govet
99+
os.Exit(1)
100+
}
101+
97102
func (l *Logger) IsEnabled(lvl slog.Level) bool {
98103
ctx := context.Background()
99104
return l.Log.Handler().Enabled(ctx, lvl)

0 commit comments

Comments
 (0)