Skip to content

Commit c2b9132

Browse files
authored
fix(cli): always output fatal errors to stderr (#6827)
Signed-off-by: knqyf263 <[email protected]>
1 parent aa0c413 commit c2b9132

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/log/logger.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ func Errorf(format string, args ...any) { slog.Default().Error(fmt.Sprintf(forma
6767

6868
// Fatal for logging fatal errors
6969
func Fatal(msg string, args ...any) {
70-
slog.Default().Log(context.Background(), LevelFatal, msg, args...)
70+
// Fatal errors should be logged to stderr even if the logger is disabled.
71+
New(NewHandler(os.Stderr, &Options{})).Log(context.Background(), LevelFatal, msg, args...)
7172
os.Exit(1)
7273
}
7374

0 commit comments

Comments
 (0)