Skip to content

Allow opting out of OpenStudio stdout logger silencing - #128

Open
nllong wants to merge 2 commits into
developfrom
allow-silencing-logger
Open

Allow opting out of OpenStudio stdout logger silencing#128
nllong wants to merge 2 commits into
developfrom
allow-silencing-logger

Conversation

@nllong

@nllong nllong commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an OSMCP_SKIP_OPENSTUDIO_LOGGER_SILENCE environment variable escape hatch in stdout_suppression.py so callers can opt out of the OpenStudio stdout logger being silenced (Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)) when set to 1/true/yes.
  • Updates the README Docker run examples to include -e OSMCP_SANDBOX=posix, matching the documented sandbox behavior described later in the file.

Why

  • Gives operators a way to re-enable OpenStudio's native stdout logger output for debugging (Class B stdout suppression, see stdout_suppression.py docstring) without needing a code change.
  • Keeps the README run examples consistent with the sandbox env var documentation.

Testing

  • No behavior change by default (env var unset preserves current silencing behavior).
  • Documentation-only change to README.

…_SANDBOX in README examples

- stdout_suppression.py: allow opting out of the OpenStudio stdout
  logger silencing via OSMCP_SKIP_OPENSTUDIO_LOGGER_SILENCE for cases
  where the caller wants the raw logger output.
- README.md: add the missing -e OSMCP_SANDBOX=posix flag to the
  Docker run examples so they match the documented sandbox behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nllong
nllong requested a review from brianlball August 11, 2026 17:52
Flip the opt-out flag to default to "true" (suppress) since a SWIG
bindings issue writes OpenStudio logger output directly to process
stdout, corrupting the MCP JSON-RPC context. Set
OSMCP_SKIP_OPENSTUDIO_LOGGER_SILENCE=false/0/no to disable
suppression for local debugging.

Add a test covering the opt-out path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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