fix(cmd/joj3): runID to new handler
All checks were successful
submodules sync / sync (push) Successful in 42s
build / build (push) Successful in 1m27s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-11-02 02:07:59 -04:00
parent e0cc65f6a5
commit 29d34dd822
GPG Key ID: D47306D7062CDA9D

View File

@ -84,9 +84,10 @@ func setupSlog(logPath string) error {
handlers = append(handlers, stderrHandler)
// Create a multi-handler
multiHandler := &multiHandler{handlers: handlers}
multiHandler.WithAttrs([]slog.Attr{slog.String("runID", runID)})
multiHandlerWithAttrs := multiHandler.WithAttrs(
[]slog.Attr{slog.String("runID", runID)})
// Set the default logger
logger := slog.New(multiHandler)
logger := slog.New(multiHandlerWithAttrs)
slog.SetDefault(logger)
if logPath != "" {
slog.Info("debug log", "path", logPath)