DiamondLightSource / hyperion

Unattended Data Collection using BlueSky / Ophyd
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Include device name in ophyd async debug logs #1421

Closed olliesilvester closed 2 weeks ago

olliesilvester commented 1 month ago

The newly added ophyd async logs give us the option to add the specific device name in to each logging message. We aren't currently doing this. If we enable it, a message like: [2024-05-21 15:47:37,789] ophyd_async.devices signal DEBUG: Making subscription on source pva://BL03I-DI-OAV-01:PVA:ARRAY, would change to: [2024-05-21 15:47:37,789] ophyd_async.devices signal DEBUG: [device_name]:Making subscription on source pva://BL03I-DI-OAV-01:PVA:ARRAY, where device name is set by us, or an empty string. We can enable this by running config_ophyd_async_logging, during the logging setup in dodal, making sure that the new handler created from this correctly propagates to the dodal logger.

Acceptance Criteria

config_ophyd_async_logging is called during our logging setup, and the handler propagates to the parent logger