Repository navigation
chore: migrate log.Printf to log/slog in agent and cmd - #533
Open
brixtonpham wants to merge 1 commit into
Open
brixtonpham wants to merge 1 commit into
brixtonpham wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Context
Follow-up to #488 (
traffic/,egress/,enrich/,evidence/) and disjoint from #523 (llmpool/,llmrec/,intercept/,db/). All remaining non-testlog.Printf/log.Print/log.Printlncalls inagent/andcmd/still used unstructured formatting instead oflog/slog, so the logs view had to guess severity from message text instead of reading thesloglevel word directly.Changes
log.Print/log.Printfcall sites across 11 files inagent/(assembly.go,compaction.go,coverage.go,noa.go,provider.go,spill.go,toolrag.go,tools.go,tools_insert.go,triage.go,worker.go) and all 13 non-fatallog.Printf/log.Printlncall sites acrosscmd/artex/main.goandcmd/artex-archive-check/main.gowithlog/slog(slog.Info,slog.Warn,slog.Error).[tag]prefix ([agent],[compaction],[config],[coverage],[insert_assets],[llm-test],[noa],[tool-rag],[tools],[triage]) soserver/logsink.goparseLogkeeps the tag badges and reads the exactsloglevel word directly.log.Fatal/log.Fatalfcalls incmd/unchanged.[llm-test]connection-attempt log (agent/provider.go) into structured single-line attributes (response_bodyviaclipBody) and structured[noa]diagnostics as a quotedmsgattribute.agent/slog_test.goverifying[tag]andsloglevel preservation throughlog.Default().Testing
gofmt -l agent/ cmd/— cleanlog.Print*calls in non-testagent/andcmd/filesgo build ./...— passedgo vet ./...— passedgo test -race -p 1 ./agent ./cmd/...— passed (agent,cmd/artex; Postgres-dependent tests skipped withoutARTEX_PG_DSN)go test -p 1 ./server -run TestParseLog— passed