Commit a774683
authored
[log] Add debug logging to difc/sink_server_ids (#2034)
## Summary
Adds a debug logger (`logSink`) to `internal/difc/sink_server_ids.go`
using the project's standard `logger.New("difc:sink_server_ids")`
pattern. This file configures which backend server IDs receive DIFC tag
snapshot enrichment in RPC JSONL logs, and previously had no debug
visibility.
## Changes
**File modified:** `internal/difc/sink_server_ids.go`
- Added `logger` import and `var logSink =
logger.New("difc:sink_server_ids")` declaration
- **`SetSinkServerIDs`**: logs input count on entry, logs when config is
cleared, logs skipped duplicate IDs, logs final normalized IDs and count
after sorting
- **`IsSinkServerID`**: logs when a match is found (called frequently,
so only logs on positive match to minimize noise)
## Logging calls added (5 total)
| Location | Message | Purpose |
|---|---|---|
| `SetSinkServerIDs` entry | `Setting sink server IDs: input_count=N` |
Trace configuration calls |
| `SetSinkServerIDs` empty case | `No sink server IDs provided, clearing
configuration` | Visible config reset |
| `SetSinkServerIDs` loop | `Skipping duplicate sink server ID: %s` |
Debug dedup logic |
| `SetSinkServerIDs` end | `Sink server IDs configured: count=N,
ids=[...]` | Final state confirmation |
| `IsSinkServerID` match | `Sink server ID match: serverID=%s` | Trace
positive lookups |
## Logger naming convention
Follows `pkg:filename` convention: `"difc:sink_server_ids"` for
`internal/difc/sink_server_ids.go`.
## Testing
Enable with `DEBUG=difc:* ./awmg --config config.toml` to see all difc
debug logs including the new sink server ID logs.
> Generated by [Go Logger
Enhancement](https://github.com/github/gh-aw-mcpg/actions/runs/23152584774)
·
[◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw-mcpg+%22gh-aw-workflow-id%3A+go-logger%22&type=pullrequests)
<!-- gh-aw-agentic-workflow: Go Logger Enhancement, engine: copilot, id:
23152584774, workflow_id: go-logger, run:
https://github.com/github/gh-aw-mcpg/actions/runs/23152584774 -->
<!-- gh-aw-workflow-id: go-logger -->1 file changed
Lines changed: 33 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
17 | 28 | | |
18 | | - | |
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
22 | 35 | | |
23 | 36 | | |
24 | 37 | | |
| |||
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
| 46 | + | |
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
| |||
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
41 | 64 | | |
42 | 65 | | |
43 | 66 | | |
44 | 67 | | |
45 | 68 | | |
46 | | - | |
47 | | - | |
| 69 | + | |
48 | 70 | | |
49 | 71 | | |
50 | | - | |
| 72 | + | |
| 73 | + | |
51 | 74 | | |
52 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
53 | 82 | | |
54 | 83 | | |
0 commit comments