mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
serverboot.Fatal: Allow additional slog arguments (#1908)
Prefactor for unified config file.
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user