logging: add a helper for registering a rotating file log that captures all output regardless of stdout log level - #6
Merged
Conversation
ianohara
changed the base branch from
ian-unused-imports-and-logging
to
ian-microcontroller-logging
October 24, 2024 19:32
ianohara
force-pushed
the
ian-microcontroller-logging
branch
from
October 25, 2024 21:16
35cdd64 to
bd6ea51
Compare
ianohara
force-pushed
the
ian-file-logging
branch
from
October 25, 2024 21:20
6ac5f03 to
8deac34
Compare
hongquanli
added a commit
that referenced
this pull request
May 18, 2026
…tbeat-skip, etc. Addresses six issues from the copilot-pull-request-reviewer bot review: #1 (cephla.py): Call acknowledge_aborted_command() after catching CommandAborted (and after the inner resend failure if it was also a CommandAborted), so the next send_command doesn't log the spurious "Last command aborted and not cleared before new command sent!" warning. The inner ack is gated on isinstance(e2, CommandAborted) to avoid the "ack with nothing to ack" path on TimeoutError. #2 (cephla.py): Drop the redundant `target_usteps = ...` recompute after _home_wheel. config and target_pos haven't changed and _target_pos_to_usteps doesn't depend on current_pos. #3 (cephla.py): Fix _home_wheel docstring — wheel is driven to config.min_index (typically slot 1), not "slot 0". #5 (firmware/serial_communication.cpp): Skip the `mcu_cmd_execution_status = COMPLETED_WITHOUT_ERRORS` reset when processing a HEARTBEAT. The keepalive has no result to report, and resetting would clobber a pending CMD_EXECUTION_ERROR from the previous command if the broadcast hasn't fired yet. Eliminates the narrow race where heartbeat traffic interleaves a failure broadcast. #6 (firmware/stage_commands.cpp): Split mark_move_failed() into two helpers — mark_move_failed() (for paths that already set mcu_cmd_execution_in_progress = true) and report_move_error() (for early-return paths that didn't). The !enabled branch in dispatch_filterwheel_move now uses report_move_error() so it doesn't spuriously unwind in_progress for an unrelated motion in flight on another axis. Invariant: only the function that claimed in_progress gets to clear it. #7 (test_filter_wheel.py): Add `getattr(mc, move_rel_attr).assert_not_called()` to both parametrized CommandAborted/TimeoutError tests, so the absolute-MOVETO recovery path is enforced — fall-back to relative MOVE would now be caught.
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.
This makes it so we can start logging to a file, and have users send the file upon crashing. It's setup such that, regardless of
set_stdout_log_level, all logs down toDEBUGgo to the file.Tested by: Unit tests, and running
main_hcs.pywith and without--verboseand making sure that log output appears in stdout and the log file as expected.