-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tidy up i24 serial logs #572
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #572 +/- ##
==========================================
+ Coverage 78.67% 80.00% +1.32%
==========================================
Files 97 97
Lines 6848 6806 -42
==========================================
+ Hits 5388 5445 +57
+ Misses 1460 1361 -99
|
Deferred to after #573 is done and running on the beamline because of permission problems if run by staff/users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this wasn't actually finished yet, but I've added some comments anyway
@@ -103,7 +106,7 @@ def config( | |||
integrate_all_logs=False, | |||
) | |||
# Remove dodal StreamHandler to avoid duplication of messages above debug | |||
dodal_logger.removeHandler(dodal_logger.handlers[0]) | |||
# dodal_logger.removeHandler(dodal_logger.handlers[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should: remove this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was accidentally commented out, sorry, fixed it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added some small comments. There are quite a few lines with no test coverage, but I will approve anyway as I know you're keen to test a release today.
A lot of the the untested lines are logging statements, I'd suggest testing them using by setting up logging in pytest_runtest_setup(item)
in an i24 conftest, similiar to what we have in mx-bluesky/tests/conftest.py
. Then we can easily assert logging calls after a@patch("mx_bluesky.beamlines.i24.serial.log.SSX_LOGGER")
logger.addHandler(logging.NullHandler()) | ||
logger.parent = dodal_logger | ||
SSX_LOGGER = logging.getLogger("I24serial") | ||
SSX_LOGGER.addHandler(logging.NullHandler()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the NullHandler
for?
@@ -68,10 +58,8 @@ def _read_visit_directory_from_file() -> Path: | |||
|
|||
|
|||
def _get_logging_file_path() -> Path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might have already discussed this, but I can't remember. How come this needs to be in a different location to that given by the common util function (/dls_sw/{beamline}/logs/bluesky/)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SO that users/staff can access it, this is the logger that looks like the old output they are used to. May not be needed for long, but for the moment it's useful for debugging
# Open the edm screen for a fixed target serial collection | ||
echo "Starting fixed target edm screen." | ||
edm -x "${edm_path}/FT-gui/DiamondChipI24-py3v1.edl" | ||
|
||
echo "Edm screen closed, bye!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no more bye!
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... it's three lines or so later :)
Closes #557