Skip to content

Commit 6b6b80e

Browse files
authored
fix: route all slog output through component logger (#91)
Set slog.SetDefault after creating the component logger so that direct slog.Info() calls in pkg/tools/loop.go and other packages use the same handler (JSON in K8s, color text in terminals) instead of Go's default text format. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Pavel Anni <panni@redhat.com>
1 parent bdd8048 commit 6b6b80e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/cmd/serve.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"log/slog"
78
"net/http"
89
"os"
910
"os/signal"
@@ -290,6 +291,7 @@ func runServe(cmd *cobra.Command, args []string) error {
290291
}
291292

292293
log := logger.New(logger.ComponentAgent)
294+
slog.SetDefault(log.Logger)
293295

294296
// Load OS tool inventory and inject into system prompt
295297
const toolsJSONPath = "/etc/docsclaw/tools.json"

0 commit comments

Comments
 (0)