Repository navigation
🔧 Internal: Migrated all print() output to structured logging #9
ayushh0110
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What changed
We've migrated all
print()calls across 36 source files (~250 calls) to Python'sloggingmodule. This is a purely internal change — no features were added or removed, and no APIs changed.All log output now goes through a centralized
screenmind.*logger hierarchy and writes to stderr (never stdout).Why
MCP stability — ScreenMind's MCP server uses stdio transport. Any stray
print()to stdout corrupts the protocol and crashes IDE integrations (Cursor, VS Code, etc.). This was the fix(deps): bump pydantic to >=2.11.0 for mcp[cli] compatibility #1 cause of MCP connection drops.Log levels — You can now filter by severity (
DEBUG,INFO,WARNING,ERROR) instead of grepping through unstructured output.File logging — You can now write logs to a file for easier debugging and sharing.
New environment variables
SCREENMIND_LOG_LEVELINFODEBUGfor verbose output,WARNINGfor quietSCREENMIND_LOG_FILEscreenmind.log) to enable rotating file logging (10MB × 3 backups)Example — enable debug logging + file output:
If something breaks
This migration touched 36 files. While we've run extensive verification (411 tests passing, structural audits, runtime import checks, MCP stdout contamination tests), if you encounter any issues:
SCREENMIND_LOG_LEVEL=DEBUGand share the output in a bug reportpython main.py 2>screenmind.loggit checkout 71bbb4cFor contributors
New coding conventions are documented in CONTRIBUTING.md:
print()— uselogger.info()/logger.warning()/logger.error()insteadlogging.getLogger("screenmind.<module.path>")flake8-printand 3 automated convention testsCommit:
a3e621a— 39 files changed, +608/-346 linesAll reactions