Skip to content

Commit 78dd030

Browse files
committed
configure_rabbitmq: Always output to stdout handler
1 parent 106bce7 commit 78dd030

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
History
33
=======
44

5+
Unreleased
6+
----------
7+
- Fixed blank output from ``zocalo.configure_rabbitmq`` when zocalo logging is configured. (`#286 <https://github.com/DiamondLightSource/python-zocalo/pull/286>`)
8+
59
1.3.0 (2025-07-04)
610
------------------
711
- Minimum supported python is now 3.11.

src/zocalo/cli/configure_rabbitmq.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ def _configure_users(api, rabbitmq_user_config_area: Path):
386386

387387
def run():
388388
logging.basicConfig(level=logging.INFO, format="%(message)s")
389+
handler = logging.getLogger().handlers[0]
390+
389391
zc = zocalo.configuration.from_file()
390392
zc.activate()
391393
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
@@ -405,6 +407,10 @@ def run():
405407
zc.add_command_line_options(parser)
406408
args = parser.parse_args()
407409

410+
# Zocalo config can remove the handler, hiding errors
411+
if handler not in logging.getLogger().handlers:
412+
logging.getLogger().addHandler(handler)
413+
408414
api = RabbitMQAPI.from_zocalo_configuration(zc)
409415

410416
with open(args.configuration) as in_file:

0 commit comments

Comments
 (0)