Repository navigation
refactor(execution,cli): route streaming debug prints through logging - #113
Merged
Merged
Conversation
Replace the leftover `print("[DEBUG] ...", file=sys.stderr)` calls in the
streaming hot path with a module `logging.getLogger(__name__)` at DEBUG
level, matching the convention already used in planning/layer_strategies.py.
- fiberpath/execution/marlin.py: 12 [DEBUG] prints -> LOGGER.debug, and the 2
[ERROR] prints -> LOGGER.error, removing the per-method `import sys`.
- fiberpath_cli/interactive.py: 18 [DEBUG] prints -> LOGGER.debug. Module
`import sys` retained (used by the stdin/stdout JSON protocol).
The stdout JSON-line protocol the Tauri side parses is untouched; only stderr
debug noise is affected. With no handler configured, DEBUG/INFO stay silent by
default, so a normal run is quiet.
Adds a regression test asserting a stream/pause/resume cycle emits no [DEBUG]
on stderr.
Closes #102
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.
What
Replace the leftover
print("[DEBUG] ...", file=sys.stderr, flush=True)calls in the streaming hot path with a modulelogging.getLogger(__name__)at DEBUG level, matching the convention already used inplanning/layer_strategies.py.Why
These debug prints run on the GUI's streaming hot path (the CLI
interactivemode is the GUI's streaming backend) and spam stderr during normal pause/resume/cancel operations. They're development leftovers. Routing them throughloggingmakes them opt-in and keeps stderr clean by default.How
fiberpath/execution/marlin.py: 12[DEBUG]prints →LOGGER.debug, and the 2[ERROR]prints →LOGGER.error; removed the per-methodimport sys.fiberpath_cli/interactive.py: 18[DEBUG]prints →LOGGER.debug. The module-levelimport sysis kept — it backs the stdin/stdout JSON protocol (for line in sys.stdin), not debug.%sargs.The stdout JSON-line protocol the Tauri/Rust side parses (
send_response→print(json.dumps(...))) is untouched; only stderr debug noise is affected. No handler is configured in library code, so DEBUG/INFO stay silent by default.Verification
grep [DEBUG]→ zero matches in both files.[DEBUG]on stderr (capsys); would have failed before this change.ruff,ruff format --check,mypy(strict, 37 files), fullpytest(117 passed): all green.Builds on #103 (same
marlin.pymethods); rebased on top of it. Closes #102