[log] Add debug logger to config/config_stdin.go#1433
Merged
Conversation
Add logger.New("config:config_stdin") debug logger with 5 targeted logging
calls to aid troubleshooting of stdin JSON config parsing:
- convertStdinConfig: log server count at entry
- convertStdinConfig: log when no gateway config is present and defaults apply
- convertStdinServerConfig: log server name and resolved type
- buildStdioServerConfig: log when a custom container entrypoint is used
- normalizeLocalType: log when 'local' type is normalized to 'stdio'
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds targeted debug logging to the stdin (JSON) configuration parsing/conversion path to improve troubleshooting without changing behavior.
Changes:
- Introduces a dedicated debug logger for
internal/config/config_stdin.go(config:config_stdin). - Adds 5 debug log statements at key decision points in stdin config conversion (server count, gateway defaults, per-server type, custom entrypoint, and
local→stdionormalization).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Adds a
logger.New("config:config_stdin")debug logger tointernal/config/config_stdin.gowith 5 targeted logging calls to improve troubleshooting of the stdin JSON configuration parsing path.Changes
File modified:
internal/config/config_stdin.goNew logger declaration
Logging calls added
convertStdinConfig"Converting stdin config: %d servers"— logs server count at entryconvertStdinConfig"No gateway config in stdin, applying defaults"— logs when defaults are appliedconvertStdinServerConfig"Converting server %q: type=%s"— logs server name and resolved typebuildStdioServerConfig"Server %q: using custom entrypoint %q"— logs non-default entrypointnormalizeLocalType"Normalized 'local' server type to 'stdio' for backward compatibility"— logs backward-compat normalizationWhy these locations?
convertStdinConfig: Entry point for conversion; knowing the server count helps diagnose config issuesconvertStdinServerConfig: Type resolution is a key decision point; loggingname+typemakes it easy to trace per-server parsingbuildStdioServerConfig: Custom entrypoints affect container behaviour and are worth flagging in debug outputnormalizeLocalType: Silent backward-compat transformation that can be confusing; making it visible aids debuggingHow to see the logs
Checklist
pkg:filenameconvention (config:config_stdin)logConfigcalls