Skip to content

Commit 052b80a

Browse files
authored
Add logging around global path provider use (#1917)
Intended to give some insight into who is using what before we remove the global path provider.
1 parent fd21a9e commit 052b80a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dodal/common/beamlines/beamline_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ophyd_async.core import Device as OphydV2Device
1313
from ophyd_async.core import wait_for_connection as v2_device_wait_for_connection
1414

15+
from dodal.log import LOGGER
1516
from dodal.utils import (
1617
AnyDevice,
1718
BeamlinePrefix,
@@ -162,6 +163,11 @@ def decorator(factory: Callable[[], T]) -> DeviceInitializationController[T]:
162163
def set_path_provider(provider: PathProvider):
163164
global PATH_PROVIDER
164165

166+
LOGGER.info(
167+
"Setting global path provider to %s (previously %s)",
168+
provider,
169+
globals().get("PATH_PROVIDER"),
170+
)
165171
PATH_PROVIDER = provider
166172

167173

@@ -171,6 +177,7 @@ def get_path_provider() -> PathProvider:
171177

172178
def clear_path_provider() -> None:
173179
global PATH_PROVIDER
180+
LOGGER.info("Clearing global path provider: %s", globals().get("PATH_PROVIDER"))
174181
try:
175182
del PATH_PROVIDER
176183
except NameError:

0 commit comments

Comments
 (0)