repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
d1cb688
parent
a5e8f68
author
Antonio Mika
date
2025-02-27 13:21:46 -0500 EST
Ensure pipe logger gets attrs
1 files changed,  +3, -1
M shared/config.go
+3, -1
 1@@ -281,13 +281,15 @@ func CreateLogger(space string) *slog.Logger {
 2 				Level:     slog.LevelInfo,
 3 			},
 4 		),
 5-	).With("service", space)
 6+	)
 7 
 8 	if strings.ToLower(utils.GetEnv("PICO_PIPE_ENABLED", "true")) == "true" {
 9 		conn := NewPicoPipeClient()
10 		logger = pipeLogger.RegisterReconnectLogger(context.Background(), logger, conn, 100, 10*time.Millisecond)
11 	}
12 
13+	logger = logger.With("service", space)
14+
15 	hostname, err := os.Hostname()
16 	if err == nil && hostname != "" {
17 		logger = logger.With("hostname", hostname)