From 92acfce45f633934561963856301f12ddd6e843c Mon Sep 17 00:00:00 2001 From: Tucker Date: Sat, 6 Jan 2024 13:02:29 -0500 Subject: [PATCH] Put sensor manager logging back to default. --- smarts/core/sensor_manager.py | 9 ++++----- smarts/core/vehicle.py | 9 ++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/smarts/core/sensor_manager.py b/smarts/core/sensor_manager.py index 521528072f..c00c323245 100644 --- a/smarts/core/sensor_manager.py +++ b/smarts/core/sensor_manager.py @@ -44,7 +44,6 @@ class SensorManager: def __init__(self): self._logger = logging.getLogger(self.__class__.__name__) - self._logger.setLevel(logging.INFO) self._sensors: Dict[str, Sensor] = {} # {actor_id: } @@ -179,12 +178,12 @@ def teardown(self, renderer): def add_sensor_state(self, actor_id: str, sensor_state: SensorState): """Add a sensor state associated with a given actor.""" - self._logger.info("Sensor state added for actor '%s'.", actor_id) + self._logger.debug("Sensor state added for actor '%s'.", actor_id) self._sensor_states[actor_id] = sensor_state def remove_sensor_state_by_actor_id(self, actor_id: str): """Add a sensor state associated with a given actor.""" - self._logger.info("Sensor state removed for actor '%s'.", actor_id) + self._logger.debug("Sensor state removed for actor '%s'.", actor_id) return self._sensor_states.pop(actor_id, None) def remove_actor_sensors_by_actor_id( @@ -203,7 +202,7 @@ def remove_actor_sensors_by_actor_id( sensors_by_actor = self._sensors_by_actor_id.get(actor_id) if not sensors_by_actor: return [] - self._logger.info("Target sensor removal for actor '%s'.", actor_id) + self._logger.debug("Target sensor removal for actor '%s'.", actor_id) discarded_sensors = [] for sensor_id in sensors_by_actor: self._actors_by_sensor_id[sensor_id].remove(actor_id) @@ -219,7 +218,7 @@ def remove_sensor( self, sensor_id: str, schedule_teardown: bool = False ) -> Optional[Sensor]: """Remove a sensor by its id. Removes any associations it has with actors.""" - self._logger.info("Target removal of sensor '%s'.", sensor_id) + self._logger.debug("Target removal of sensor '%s'.", sensor_id) sensor = self._sensors.get(sensor_id) if not sensor: return None diff --git a/smarts/core/vehicle.py b/smarts/core/vehicle.py index 32e54659ac..dab6dde1cb 100644 --- a/smarts/core/vehicle.py +++ b/smarts/core/vehicle.py @@ -695,16 +695,12 @@ def _meta_create_class_sensor_functions(cls): setattr( cls, f"subscribed_to_{sensor_name}", - property( - partial(cls.subscribed_to, sensor_name=sensor_name) - ), + property(partial(cls.subscribed_to, sensor_name=sensor_name)), ) setattr( Vehicle, f"{sensor_name}", - property( - partial(cls.sensor_property, sensor_name=sensor_name) - ), + property(partial(cls.sensor_property, sensor_name=sensor_name)), ) def detach_all_sensors_from_vehicle(vehicle): @@ -724,4 +720,3 @@ def _meta_create_sensor_functions(self): # Bit of metaprogramming to make sensor creation more DRY self._meta_create_instance_sensor_functions() self._meta_create_class_sensor_functions() -