Skip to content

chore: migrate log.Printf to log/slog in server management and control - #536

Merged
BaaRai merged 3 commits into
BaaRai:mainfrom
nirlep1204:chore/migrate-slog-server
Nov 26, 2026
Merged

BaaRai merged 3 commits into
BaaRai:mainfrom
nirlep1204:chore/migrate-slog-server

Conversation

@nirlep1204

Copy link
Copy Markdown
Contributor

Summary

This PR continues the structured logging migration initiated in #523 and #533 by converting 24 legacy log.Printf call sites across server management and control components to structured log/slog (slog.Info, slog.Warn, slog.Error).

Scope of Changes

  • server/customtool.go: Python interpreter detection
  • server/llmpool.go: LLM circuit breaker and pool chain management
  • server/server_mgmt.go: Agent prompts, triggers, tool bindings, skills, and profile cleanup
  • server/task_archive_remote.go: Task archive deletion & remote cleanup pending logs
  • server/task_control.go: Task pause/resume state transitions
  • server/task_outcome.go: Outcome query failure handling
  • server/traffic_hooks.go: Tamper hooks loading and error logging
  • server/triage.go: Triage client initialization and URL validation

Compatibility & Standards

  • All existing [tag] prefixes (e.g. [llmpool], [task], [skills], [traffic]) are strictly preserved for compatibility with the log sink parser (server/logsink.go) and frontend log badge filters.
  • Replaced format strings with structured key-value attributes ("task_id", "profile_id", "err", etc.).

Test Plan

  • gofmt -l server/ (clean)
  • go build ./... (passes with exit 0)
  • go vet ./server (passes with exit 0)
  • go test -v -run TestParseLog ./server (passes with exit 0)

@5P34R

5P34R commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Review notes

Looks good to merge. Every converted call logs the same fields as before, so no secrets are newly logged. No Fatal/exit behaviour changes, and no calls are silently dropped (nothing uses slog.Debug at the default level). It touches different files from #533 and #523.

Nits:

  • [skill] frontmatter did not parse lost its "fix the YAML / loaded under the directory name" hint.
  • [triage] initialized triage client now logs on every call, including when triage is disabled (id<=0).
  • Some levels moved. For example, "archive deleted, remote cleanup pending" is now INFO; the old keyword guess classed it as an error when the text contained "failed".

@BaaRai
BaaRai force-pushed the chore/migrate-slog-server branch from d42343c to 591caa3 Compare November 26, 2026 22:24
BaaRai added a commit to Dev-next-gen/ARTEX that referenced this pull request Nov 26, 2026
@BaaRai
BaaRai force-pushed the chore/migrate-slog-server branch from 591caa3 to d95206f Compare November 26, 2026 22:40
BaaRai added a commit to Dev-next-gen/ARTEX that referenced this pull request Nov 26, 2026
@BaaRai
BaaRai force-pushed the chore/migrate-slog-server branch from d95206f to 72eafe7 Compare November 26, 2026 22:56
BaaRai added a commit to Dev-next-gen/ARTEX that referenced this pull request Nov 26, 2026
@BaaRai
BaaRai force-pushed the chore/migrate-slog-server branch from 72eafe7 to 95af051 Compare November 26, 2026 23:13
@BaaRai
BaaRai merged commit 3a7b7f8 into BaaRai:main Nov 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants