Skip to content

Commit

Permalink
use ophyd async logger for logging.debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rerpha committed Nov 29, 2024
1 parent 8b83909 commit 5544e90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ophyd_async/epics/core/_aioca.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

from ._util import EpicsSignalBackend, format_datatype, get_supported_values

logger = logging.getLogger("ophyd_async")


def _limits_from_augmented_value(value: AugmentedValue) -> Limits:
def get_limits(limit: str) -> LimitsRange | None:
Expand Down Expand Up @@ -247,7 +249,7 @@ async def _store_initial_value(self, pv: str, timeout: float):
pv, format=FORMAT_CTRL, timeout=timeout
)
except CANothing as exc:
logging.debug(f"signal ca://{pv} timed out")
logger.debug(f"signal ca://{pv} timed out")
raise NotConnected(f"ca://{pv}") from exc

async def connect(self, timeout: float):
Expand Down
4 changes: 3 additions & 1 deletion src/ophyd_async/epics/core/_p4p.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

from ._util import EpicsSignalBackend, format_datatype, get_supported_values

logger = logging.getLogger("ophyd_async")


def _limits_from_value(value: Any) -> Limits:
def get_limits(
Expand Down Expand Up @@ -282,7 +284,7 @@ async def pvget_with_timeout(pv: str, timeout: float) -> Any:
try:
return await asyncio.wait_for(context().get(pv), timeout=timeout)
except asyncio.TimeoutError as exc:
logging.debug(f"signal pva://{pv} timed out", exc_info=True)
logger.debug(f"signal pva://{pv} timed out", exc_info=True)
raise NotConnected(f"pva://{pv}") from exc


Expand Down
4 changes: 3 additions & 1 deletion src/ophyd_async/tango/core/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

from ._tango_transport import TangoSignalBackend, get_python_type

logger = logging.getLogger("ophyd_async")


def make_backend(
datatype: type[SignalDatatypeT] | None,
Expand Down Expand Up @@ -205,7 +207,7 @@ async def infer_signal_type(
if config.in_type == CmdArgType.DevVoid:
return SignalX
elif config.in_type != config.out_type:
logging.debug("Commands with different in and out dtypes are not supported")
logger.debug("Commands with different in and out dtypes are not supported")
return None
else:
return SignalRW
Expand Down

0 comments on commit 5544e90

Please sign in to comment.