Skip to content

Commit 857e57b

Browse files
authored
Merge pull request #2 from castai/add-log-fatalf
Add Fatalf method
2 parents 7a13cd7 + 40408a4 commit 857e57b

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)