[log] Replace stdlib log calls with logRouted debug logger in routed.go#6959
Merged
Conversation
Convert four log.Printf calls (standard library) to use the project's logRouted debug logger, consistent with the rest of the codebase. This ensures routed-mode debug output is controlled via the DEBUG env var, writes to both stderr (with colours) and the file logger, and follows the pkg:filename naming convention. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes logging in internal/server/routed.go by removing remaining standard-library log.Printf usage and routing those messages through the project’s logRouted debug logger, aligning the file with the repository’s debug-logger pattern.
Changes:
- Removed the
log(stdlib) import frominternal/server/routed.go. - Replaced four
log.Printfcalls withlogRouted.Printffor route registration, filtered server creation, missing handler warnings, and routed call tracing.
Show a summary per file
| File | Description |
|---|---|
internal/server/routed.go |
Removes stdlib logging and routes debug output through logRouted for consistency and debug gating. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/server/routed.gocontained fourlog.Printfcalls using the standard librarylogpackage alongside the project's ownlogRouteddebug logger. This PR converts all four to uselogRouted.Printf, making the file consistent with the rest of the codebase.Changes
"log"standard-library import fromrouted.golog.Printfcalls tologRouted.Printf:"Registered route: %s""Creating filtered server for %s with %d tools""WARNING: No handler found for %s___%s""[ROUTED] Calling unified handler for: %s"Why This Matters
Standard library
logwrites unconditionally to stderr; it cannot be filtered, coloured, or directed to the file logger. By usinglogRouted, these messages now:DEBUG=server:*(orDEBUG=*) environment variable — zero overhead when disabledmcp-gateway.logfor post-hoc analysispkg:filenamenamespace convention already used throughout the projectValidation
go build ./...— no errorsgo vet ./internal/server/...— cleango test ./internal/server/...— all tests pass