8000
Skip to content

[log] Add debug logging to agentdrain package#24383

Merged
pelikhan merged 1 commit intomainfrom
add-agentdrain-logging-4f250c3d28cbeda1
Apr 3, 2026
Merged

[log] Add debug logging to agentdrain package#24383
pelikhan merged 1 commit intomainfrom
add-agentdrain-logging-4f250c3d28cbeda1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor
@github-actions github-actions bot commented Apr 3, 2026

Adds logger.New declarations and meaningful debug log calls to five files in pkg/agentdrain/, which previously had no logging at all.

Files changed

File Logger name What's logged
miner.go agentdrain:miner Miner creation params, cluster match vs. new creation, AnalyzeEvent stage
coordinator.go agentdrain:coordinator Coordinator creation with stages, snapshot load/restore counts
persist.go agentdrain:persist SaveJSON cluster count, LoadJSON byte count and restored clusters
anomaly.go agentdrain:anomaly Anomaly score, flags (isNew, lowSim, rare), and reason string
pretrain.go agentdrain:pretrain PreTrainTemplates count, per-template token/seed counts

Validation

  • make build — passes with no errors
  • go test ./pkg/agentdrain/... — all tests pass

Notes

  • All logger args use already-computed local variables (no side effects)
  • anomaly.go uses anomalyLog.Enabled() guard before the formatted anomaly report since it accesses multiple fields
  • Follows the pkg:filename naming convention from AGENTS.md

Generated by Go Logger Enhancement · ● 698.5K ·

  • expires on Apr 5, 2026, 9:28 PM UTC

Adds logger declarations and meaningful debug log calls to five files in
the pkg/agentdrain package, which previously had no logging at all. This
enables troubleshooting of the Drain-style log template mining pipeline
by surfacing cluster creation, snapshot loading/saving, anomaly scores,
and pre-training operations when DEBUG is enabled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Apr 3, 2026
@pelikhan pelikhan merged commit cfa22cb into main Apr 3, 2026
@pelikhan pelikhan deleted the add-agentdrain-logging-4f250c3d28cbeda1 branch April 3, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0