diff --git a/pyproject.toml b/pyproject.toml index 910f5c2be..414c4c759 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "pydantic", "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@a4adbadfaae60b5158cf19647dba42b79280e103", "fastapi[all]<0.99", - "blueapi>=0.4.3-a3", + "blueapi @ git+https://github.com/DiamondLightSource/blueapi.git@main", ] dynamic = ["version"] license.file = "LICENSE" diff --git a/src/mx_bluesky/I24/serial/log.py b/src/mx_bluesky/I24/serial/log.py index 140cc8a33..05799ac97 100644 --- a/src/mx_bluesky/I24/serial/log.py +++ b/src/mx_bluesky/I24/serial/log.py @@ -5,12 +5,13 @@ from pathlib import Path from typing import Optional +from bluesky.log import logger as bluesky_logger from dodal.log import ( ERROR_LOG_BUFFER_LINES, - integrate_bluesky_and_ophyd_logging, set_up_all_logging_handlers, ) from dodal.log import LOGGER as dodal_logger +from ophyd_async.log import logger as ophyd_async_logger VISIT_PATH = Path("/dls_sw/i24/etc/ssx_current_visit.txt") @@ -19,7 +20,7 @@ class OphydDebugFilter(logging.Filter): # NOTE yet to be fully tested """Do not send ophyd debug log messages to stream handler.""" def filter(self, record): - return not record.getMessage().lower().startswith("ophyd") + return "ophyd" not in record.getMessage().lower() # Logging set up @@ -88,6 +89,13 @@ def _get_logging_file_path() -> Path: return logging_path +def integrate_bluesky_and_ophyd_logging(parent_logger: logging.Logger): + """Integrate only bluesky and ophyd_async loggers.""" + for logger in [bluesky_logger, ophyd_async_logger]: + logger.parent = parent_logger + logger.setLevel(logging.DEBUG) + + def default_logging_setup(dev_mode: bool = False): """ Default log setup for i24 serial. diff --git a/src/mx_bluesky/I24/serial/run_extruder.sh b/src/mx_bluesky/I24/serial/run_extruder.sh index 42aa4712c..94cc78a15 100755 --- a/src/mx_bluesky/I24/serial/run_extruder.sh +++ b/src/mx_bluesky/I24/serial/run_extruder.sh @@ -15,5 +15,5 @@ edm -x "${edm_path}/EX-gui/DiamondExtruder-I24-py3v1.edl" echo "Edm screen closed, bye!" -pgrep blueapi | xargs kill -9 +pgrep blueapi | xargs kill echo "Blueapi process killed" \ No newline at end of file diff --git a/src/mx_bluesky/I24/serial/run_fixed_target.sh b/src/mx_bluesky/I24/serial/run_fixed_target.sh index 58d345f28..c28e0db13 100755 --- a/src/mx_bluesky/I24/serial/run_fixed_target.sh +++ b/src/mx_bluesky/I24/serial/run_fixed_target.sh @@ -18,5 +18,5 @@ edm -x "${edm_path}/FT-gui/DiamondChipI24-py3v1.edl" echo "Edm screen closed, bye!" -pgrep blueapi | xargs kill -9 +pgrep blueapi | xargs kill echo "Blueapi process killed" \ No newline at end of file