From 118cf027b15c160ff3b085ddcdfd057eed9f10d0 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 24 Jan 2025 20:16:44 +0100 Subject: [PATCH] Revert "Revert "Log process ID in each log entry (#949)"" This reverts commit 1d5980a11eefa76ee83f0d7e9afc1cd2d13754a9. --- cmd/root/logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/root/logger.go b/cmd/root/logger.go index e3f47b978..38e09b9c9 100644 --- a/cmd/root/logger.go +++ b/cmd/root/logger.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "log/slog" + "os" "github.com/databricks/cli/libs/cmdio" "github.com/databricks/cli/libs/env" @@ -69,7 +70,7 @@ func (f *logFlags) initializeContext(ctx context.Context) (context.Context, erro return nil, err } - slog.SetDefault(slog.New(handler)) + slog.SetDefault(slog.New(handler).With(slog.Int("pid", os.Getpid()))) return log.NewContext(ctx, slog.Default()), nil }