Commit 1c83b02
authored
[log] log: add debug logging to server/difc_log (#2228)
Adds a `logDifcLog` debug logger (`"server:difc_log"` namespace) to
`internal/server/difc_log.go` and instruments the three key functions
with 5 meaningful debug logging calls.
## Changes
**File:** `internal/server/difc_log.go`
- Added `var logDifcLog = logger.New("server:difc_log")` (reuses the
existing `logger` import)
- `logFilteredItems`: logs filtered item count at entry (`serverID`,
`toolName`, `count`)
- `buildFilteredItemLogEntry`: logs extracted DIFC labels
(`description`, `secrecy`, `integrity`) and item metadata (`author`,
`number`, `URL`) when available
- `buildDIFCFilteredNotice`: logs filtered item count and which notice
format branch is selected (per-item detail vs. summary-only)
## Why this file
`difc_log.go` contains the DIFC filtering pipeline's logging and
notice-building logic. Understanding *how many* items are being
filtered, *what labels* they carry, and *which code path* the notice
builder takes is critical when debugging integrity policy violations.
The existing operational logging (via `logger.LogInfoWithServer`)
records the outcome; these debug logs trace the control flow that
produces it.
## Usage
```bash
# Enable debug logs for this file only
DEBUG=server:difc_log ./awmg --config config.toml
# Enable all server debug logs
DEBUG=server:* ./awmg --config config.toml
```
All log calls are zero-overhead when `DEBUG` does not match the
namespace.
> Generated by [Go Logger
Enhancement](https://github.com/github/gh-aw-mcpg/actions/runs/23350545859)
·
[◷](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:
23350545859, workflow_id: go-logger, run:
https://github.com/github/gh-aw-mcpg/actions/runs/23350545859 -->
<!-- gh-aw-workflow-id: go-logger -->1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| 125 | + | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
0 commit comments