Skip to content

[log] Add debug logger to config/config_stdin.go#1433

Merged
lpcox merged 1 commit intomainfrom
log/config-stdin-debug-logging-be253a0168cc9856
Feb 28, 2026
Merged

[log] Add debug logger to config/config_stdin.go#1433
lpcox merged 1 commit intomainfrom
log/config-stdin-debug-logging-be253a0168cc9856

Conversation

@github-actions
Copy link
Contributor

Adds a logger.New("config:config_stdin") debug logger to internal/config/config_stdin.go with 5 targeted logging calls to improve troubleshooting of the stdin JSON configuration parsing path.

Changes

File modified: internal/config/config_stdin.go

New logger declaration

var logStdin = logger.New("config:config_stdin")

Logging calls added

Function Log message
convertStdinConfig "Converting stdin config: %d servers" — logs server count at entry
convertStdinConfig "No gateway config in stdin, applying defaults" — logs when defaults are applied
convertStdinServerConfig "Converting server %q: type=%s" — logs server name and resolved type
buildStdioServerConfig "Server %q: using custom entrypoint %q" — logs non-default entrypoint
normalizeLocalType "Normalized 'local' server type to 'stdio' for backward compatibility" — logs backward-compat normalization

Why these locations?

  • convertStdinConfig: Entry point for conversion; knowing the server count helps diagnose config issues
  • convertStdinServerConfig: Type resolution is a key decision point; logging name + type makes it easy to trace per-server parsing
  • buildStdioServerConfig: Custom entrypoints affect container behaviour and are worth flagging in debug output
  • normalizeLocalType: Silent backward-compat transformation that can be confusing; making it visible aids debugging

How to see the logs

DEBUG=config:* ./awmg --config config.toml
# or for stdin mode:
echo '{"mcpServers": {...}}' | DEBUG=config:* ./awmg

Checklist

  • Exactly 1 file modified
  • No test files modified
  • Logger naming follows pkg:filename convention (config:config_stdin)
  • No side effects in log arguments (all arguments are plain variables)
  • Messages are meaningful and non-redundant with existing logConfig calls
  • Import properly formatted

Generated by Go Logger Enhancement

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>
@github-actions github-actions bot added automation enhancement New feature or request labels Feb 26, 2026
@lpcox lpcox marked this pull request as ready for review February 28, 2026 04:29
Copilot AI review requested due to automatic review settings February 28, 2026 04:29
@lpcox lpcox merged commit e068c68 into main Feb 28, 2026
2 checks passed
@lpcox lpcox deleted the log/config-stdin-debug-logging-be253a0168cc9856 branch February 28, 2026 04:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 localstdio normalization).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants