Skip to content

Use stderr Console for clean tool-call indicators#11

Open
pnilan wants to merge 1 commit intomainfrom
fix/tool-logging-stderr
Open

Use stderr Console for clean tool-call indicators#11
pnilan wants to merge 1 commit intomainfrom
fix/tool-logging-stderr

Conversation

@pnilan
Copy link
Owner

@pnilan pnilan commented Mar 13, 2026

What

Follow-up to #10. Replaces the logger.info call for tool-call indicators with
a Console(stderr=True) so the output is a clean 🛠️ tool call: list_midi_ports
line without logging metadata (timestamps, level, logger name).

How

  • Add a stderr_console = Console(stderr=True) in cli.py
  • Replace logger.info with stderr_console.print for the tool indicator — this
    always prints on every tool call, keeping the REPL informed without polluting stdout
  • Keep logger.debug for verbose tool args (only with -v)
  • Update tests to assert on capsys.readouterr().err instead of caplog records

Recommended Review Order

  1. patchwork/cli.py
  2. tests/test_tool_logging.py

Replace logger.info with a Rich Console(stderr=True) so tool-call
indicators print as clean "🛠️ tool call: <name>" lines without
logging metadata. The logger is now only used for verbose debug args.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant