refactor(proxy): migrate to zerolog structured logging

This commit is contained in:
Alexander
2026-04-10 18:19:13 +02:00
parent 76bf651742
commit 4e22c463cf
3 changed files with 91 additions and 17 deletions
+7 -3
View File
@@ -3,13 +3,14 @@ package proxy
import (
"fmt"
"io"
"log"
"net"
"net/http"
"os/exec"
"strings"
"sync"
"time"
"github.com/rs/zerolog/log"
)
// SniffedProfile holds everything captured from a real Claude Code request.
@@ -116,8 +117,11 @@ func SniffClaudeCode(claudeBinary string) (*SniffedProfile, error) {
return nil, fmt.Errorf("no API request captured")
}
log.Printf("sniffed claude-code: version=%s headers=%d body=%d bytes",
profile.Version, len(profile.Headers), len(profile.Body))
log.Info().
Str("version", profile.Version).
Int("headers", len(profile.Headers)).
Int("body_size", len(profile.Body)).
Msg("sniffed claude-code profile")
return profile, nil
}