Repository navigation
fix(fluidics): keep fluidics DEBUG in run.log; the rest of Squid's logging at INFO and above - #866
Open
hongquanli wants to merge 2 commits into
Open
hongquanli wants to merge 2 commits into
hongquanli wants to merge 2 commits into
Conversation
…in main_hcs.log run.log's handler sits on the squid root logger and took DEBUG, so every DEBUG line from the rest of Squid (Timer, MCU) went into it for the whole run, on top of the same lines in main_hcs.log and each round's acquisition.log. Attach it at INFO: run.log is the run's readable record, and the DEBUG detail is still in the other two logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s at INFO run.log is where a fluidics run is debugged, and the library's DEBUG lines (valve routing, sequence contents) belong there. A filter on the run.log handler now passes every fluidics record and the rest of Squid's logging at INFO and above, so the Timer and MCU DEBUG traffic stays out. The fluidics logger names now live in control/core/fluidics_protocol/logger_names.py, used by run.log, the Fluidics Log pane and the library logging bridge (they were two copies). add_file_handler takes a record_filter, attached before the handler goes on the logger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 fails
A 38 h fluidics protocol run wrote a 905 MB run.log (6.45 M lines). The same lines also went to main_hcs.log and to each round's acquisition.log, about 2.7 GB of logs for one run.
run.log's handler sits on the squid root logger at DEBUG, so it copied every DEBUG line from the rest of Squid: 42 % of run.log was Timer DEBUG and 35 % Microcontroller DEBUG.
Fix
run.log keeps every fluidics record, DEBUG included, and the rest of Squid's logging at INFO and above.
fluidics.*,XCaliburD; the logging bridge forwards their records under these names) or Squid's fluidics packages. So the library's DEBUG detail (valve routing, sequence contents) stays in run.log, and the Timer and MCU DEBUG lines do not.control/core/fluidics_protocol/logger_names.py. run.log, the GUI's Fluidics Log pane and the library logging bridge all use it; the pane and the bridge each had a copy before.squid.logging.add_file_handlertakes an optionalrecord_filter, attached before the handler goes on the logger, so the filter also applies to the file's first record.Test
test_run_log_keeps_fluidics_debug_and_the_rest_of_squid_at_info_and_aboveruns a runner with the fake ports. Mid-run it logs DEBUG and INFO from a non-fluidics squid logger, DEBUG from a Squid fluidics logger, and a library DEBUG record handed to the squid root logger the way the bridge does. run.log has the INFO line and both fluidics DEBUG lines, and not the other DEBUG line.Local results, PyQt5 and PyQt6, with the fluidics library at the pinned commit on
PYTHONPATH: the fluidics protocol, fluidics widget, fluidics system and squid logging tests, 131 passed.test_log_and_sensors.py::test_a_tall_window_shows_the_whole_instrument_blockfails locally on master too (macOS window size); CI runs it under Xvfb.Not verified
🤖 Generated with Claude Code
Summary by CodeRabbit
run.logandmain_hcs.log, so readers can better understand where to find protocol and fluidics activity.