fix: use stdlib logging instead of print (stderr)#73
Closed
Jah-yee wants to merge 1 commit into
Closed
Conversation
Maintainer feedback: use a proper logger instead of changing print to file=sys.stderr. Switch all print() calls to logging.info/error. Logger configured with basicConfig(level=INFO, stream=sys.stderr) which preserves MCP stdio JSON-RPC framing - only log messages go to stderr, tools return data on stdout. Fixes: xing5#72
Author
|
Supersedes Jah-yee/mcp-google-sheets#72. Changes: replaced print→stderr approach with stdlib logging (per maintainer request), still writes to stderr to preserve MCP stdio framing. |
Owner
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.
Maintainer feedback in #72: 'use a proper logger instead of changing print everywhere'.
This PR replaces all print() calls with Python stdlib logging, configured to write to stderr via basicConfig. This:
Changes:
import loggingandlogger = logging.getLogger(__name__)logging.basicConfig(level=INFO, stream=sys.stderr, format='%(message)s')file=sys.stderrfrom all calls (handled by basicConfig)Closes #72.