Refactor logging setup for debug flag#7
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| datefmt="%Y-%m-%d %H:%M:%S", | ||
| ) | ||
|
|
||
| logger: logging.Logger = logging.getLogger("C64Emulator") | ||
| logger.info("Logging configured") | ||
|
|
||
| return logger | ||
|
|
||
| log.setLevel(level) | ||
| log.info("Logging configured") | ||
|
|
There was a problem hiding this comment.
[P1] Configure logging in multiprocessing child processes
Removing the module‑level setup_logging() call means the logger is never configured when a new process starts. On platforms where multiprocessing uses the spawn start method (e.g. Windows), the bus worker process imports log_setup but never executes main(), so setup_logging(debug=…) is never invoked. As a result, all log.info/log.debug calls in the bus process (for example in Bus.__init__) run with the default WARNING level and no handlers, so the newly added --debug flag does not emit any logs from the core emulator. Consider configuring logging inside each process or restoring an import‑time initialization so child processes honour the debug flag.
Useful? React with 👍 / 👎.
Summary
main.pyTesting
ruff check .pytest(fails: ROM file not found)https://chatgpt.com/codex/tasks/task_e_68b07667ce54832e92ec707785da1f21