Skip to content

Commit

Permalink
TangoShutter: Now uses HWR logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mockoocy authored and marcus-oscarsson committed Feb 26, 2025
1 parent 731b7bc commit 8221e93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mxcubecore/HardwareObjects/TangoShutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
__copyright__ = """ Copyright © by the MXCuBE collaboration """
__license__ = "LGPLv3+"

hwr_logger = logging.getLogger("HWR")


@unique
class TangoShutterStates(Enum):
Expand Down Expand Up @@ -136,7 +138,7 @@ def _initialise_values(self) -> None:
else:
values_dict.update({key: val})
except (ValueError, TypeError):
logging.exception("Exception in _initialise_values()")
hwr_logger.exception("Exception in _initialise_values()")

self.VALUES = Enum("ValueEnum", values_dict)
self.SPECIFIC_STATES = Enum("TangoShutterStates", states_dict)
Expand All @@ -151,7 +153,7 @@ def get_state(self) -> HardwareObjectState:
_state = self.get_value().name
return self.SPECIFIC_STATES[_state].value[0]
except (AttributeError, KeyError):
logging.exception("Exception in get_state()")
hwr_logger.exception("Exception in get_state()")
return self.STATES.UNKNOWN

def get_value(self) -> TangoShutterStates:
Expand Down

0 comments on commit 8221e93

Please sign in to comment.