Commit 20d3459
authored
[log] Add debug logging to server/session.go (#2673)
Adds a dedicated `logSession` debug logger to
`internal/server/session.go` using the project's `logger.New()`
framework with namespace `"server:session"`.
## Changes
**File modified:** `internal/server/session.go`
Added `var logSession = logger.New("server:session")` and 4 debug
logging calls:
| Function | Log message |
|---|---|
| `NewSession` | `Creating new session: sessionID=%s, has_token=%v` |
| `getSessionID` | `Extracted session ID from context: %s` |
| `requireSession` | `Checking session: sessionID=%s` |
| `getSessionKeys` | `Active sessions: count=%d` |
## Usage
Enable debug output:
```bash
DEBUG=server:session ./awmg --config config.toml
DEBUG=server:* ./awmg --config config.toml
```
## Checklist
- [x] Exactly 1 file modified
- [x] No test files modified
- [x] Logger declaration added (`var logSession =
logger.New("server:session")`)
- [x] Logger naming follows `pkg:filename` convention
- [x] Logger arguments have no side effects
- [x] Messages are meaningful and helpful for debugging
- [x] No duplicate logging with existing logs (complements stdlib
`log.Printf` calls)
> Generated by [Go Logger
Enhancement](https://github.com/github/gh-aw-mcpg/actions/runs/23662556318)
·
[◷](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,
model: auto, id: 23662556318, workflow_id: go-logger, run:
https://github.com/github/gh-aw-mcpg/actions/runs/23662556318 -->
<!-- gh-aw-workflow-id: go-logger -->1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
0 commit comments