serverboot.Fatal: Allow additional slog arguments (#1908)

Prefactor for unified config file.
This commit is contained in:
Taahir Ahmed
2026-09-26 01:29:52 +00:00
committed by GitHub
parent d3aec58cdd
commit fe82dae3f3
+4 -2
View File
@@ -279,8 +279,10 @@ func newMeterProvider(ctx context.Context, serviceName string, relayCapable bool
// Fatal logs msg + err and exits with status 1. For startup-time // Fatal logs msg + err and exits with status 1. For startup-time
// fail-fast where there's no recovery path. // fail-fast where there's no recovery path.
func Fatal(ctx context.Context, msg string, err error) { func Fatal(ctx context.Context, msg string, err error, additionalArgs ...any) {
slog.ErrorContext(ctx, msg, slog.Any("err", err)) args := []any{slog.Any("err", err)}
args = append(args, additionalArgs...)
slog.ErrorContext(ctx, msg, args...)
os.Exit(1) os.Exit(1)
} }