diff --git a/src/hyperion/external_interaction/callbacks/__main__.py b/src/hyperion/external_interaction/callbacks/__main__.py index 37314f797..2c6520109 100644 --- a/src/hyperion/external_interaction/callbacks/__main__.py +++ b/src/hyperion/external_interaction/callbacks/__main__.py @@ -4,6 +4,7 @@ from typing import Callable, Sequence from bluesky.callbacks.zmq import Proxy, RemoteDispatcher +from dodal.log import LOGGER as dodal_logger from dodal.log import set_up_all_logging_handlers from hyperion.external_interaction.callbacks.log_uid_tag_callback import ( @@ -65,6 +66,7 @@ def setup_logging(dev_mode: bool): log_info(f"Loggers initialised with dev_mode={dev_mode}") nexgen_logger = logging.getLogger("nexgen") nexgen_logger.parent = NEXUS_LOGGER + dodal_logger.parent = ISPYB_LOGGER log_debug("nexgen logger added to nexus logger") diff --git a/tests/unit_tests/external_interaction/callbacks/test_external_callbacks.py b/tests/unit_tests/external_interaction/callbacks/test_external_callbacks.py index 519d23416..2562ac84a 100644 --- a/tests/unit_tests/external_interaction/callbacks/test_external_callbacks.py +++ b/tests/unit_tests/external_interaction/callbacks/test_external_callbacks.py @@ -5,6 +5,7 @@ import pytest from bluesky.callbacks.zmq import Proxy, RemoteDispatcher +from dodal.log import LOGGER as DODAL_LOGGER from hyperion.external_interaction.callbacks.__main__ import ( main, @@ -49,11 +50,13 @@ def test_setup_callbacks(): return_value=True, ) def test_setup_logging(parse_callback_cli_args): + assert DODAL_LOGGER.parent != ISPYB_LOGGER assert len(ISPYB_LOGGER.handlers) == 0 assert len(NEXUS_LOGGER.handlers) == 0 setup_logging(parse_callback_cli_args()) assert len(ISPYB_LOGGER.handlers) == 4 assert len(NEXUS_LOGGER.handlers) == 4 + assert DODAL_LOGGER.parent == ISPYB_LOGGER setup_logging(parse_callback_cli_args()) assert len(ISPYB_LOGGER.handlers) == 4 assert len(NEXUS_LOGGER.handlers) == 4