Commit ab5d495
authored
[Repo Assist] fix: remove redundant log.Printf calls from connection.go (#3640)
🤖 *This PR was created by Repo Assist, an automated AI assistant.*
Addresses #3633.
## Problem
`internal/mcp/connection.go` had five `log.Printf` calls that either
duplicated adjacent `logger.LogInfo` structured-log calls or wrote to
stderr with no structured counterpart. This meant:
- Operators monitoring `mcp-gateway.log` would miss some events (e.g.
"Started MCP server")
- Operators watching stderr got duplicate lines for the same event with
slightly different wording
- The `"log"` standard-library import persisted only to serve these
calls
## Changes
| Line | Old | New |
|------|-----|-----|
| 144 | `log.Printf("Starting MCP server command: ...")` | Removed —
`logger.LogInfo` on line 143 already covers this |
| 148 | `log.Printf("Connecting to MCP server...")` | Removed —
`logConn.Print("Initiating MCP server connection and handshake")` on the
next line already covers this at debug level |
| 178 | `log.Printf("Started MCP server: ...")` | Replaced with
`logger.LogInfo("backend", "Started MCP server: ...")` — now written to
`mcp-gateway.log` |
| 241 | `log.Printf("Configured HTTP MCP server with streamable
transport: ...")` | Removed — `logger.LogInfo` on line 240 already
covers this |
| 264 | `log.Printf("Configured HTTP MCP server with plain JSON-RPC
transport: ...")` | Removed — `logger.LogInfo` on line 263 already
covers this |
The now-unused `"log"` standard-library import is also removed.
## Test Status
1 file changed
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | | - | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
148 | | - | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
| |||
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
178 | | - | |
| 175 | + | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
| |||
238 | 235 | | |
239 | 236 | | |
240 | 237 | | |
241 | | - | |
242 | 238 | | |
243 | 239 | | |
244 | 240 | | |
| |||
261 | 257 | | |
262 | 258 | | |
263 | 259 | | |
264 | | - | |
265 | 260 | | |
266 | 261 | | |
267 | 262 | | |
| |||
0 commit comments