Fix logging polluting stdout space for mcp (#8) #9
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.
Pull Request Overview
This PR implements a logging abstraction to prevent log pollution of stdout space for MCP (Model Context Protocol) usage. All console logging has been replaced with a custom Logger class that outputs to stderr with prefixed tags to avoid interfering with MCP communication.
Commit logs:
* bugfix: print/log to sys.stderr insted of sys.stdout (#6)Printing/logging sys.stdout causes initialization problems:
2025-08-04T17:31:34.484+02:00 DEBUG 43668 --- [mcp-tests] [pool-2-thread-1] io.modelcontextprotocol.spec.McpSchema : Received JSON message: Topic 'MY_TOPIC' is marked as public. No authentication required.
2025-08-04T17:31:34.485+02:00 ERROR 43668 --- [mcp-tests] [pool-2-thread-1] i.m.c.transport.StdioClientTransport : Error processing inbound message for line: Topic 'MY_TOPIC' is marked as public. No authentication required.
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Topic': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (
StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
disabled); line: 1, column: 6]Printing/logging sys.stdout causes initialization problems:
Error processing inbound message for line: Sending notification to http://server.example/TOPIC with Markdown formatting
add logger class abstraction using console.error to prevent initialization issues
update build files
bump version and update readme and include github pull request template