device: downgrade warning about removing missing notification handler to info message

This commit is contained in:
Peter F. Patel-Schneider 2021-04-21 13:39:41 -04:00
parent 4edbf51f17
commit 1c1be84e59
1 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import errno as _errno import errno as _errno
from logging import INFO as _INFO from logging import INFO as _INFO
from logging import WARNING as _WARNING
from logging import getLogger from logging import getLogger
from typing import Optional from typing import Optional
@ -419,8 +418,8 @@ class Device(object):
def remove_notification_handler(self, id: str): def remove_notification_handler(self, id: str):
"""Unregisters the notification handler under name `id`.""" """Unregisters the notification handler under name `id`."""
if id not in self._notification_handlers and _log.isEnabledFor(_WARNING): if id not in self._notification_handlers and _log.isEnabledFor(_INFO):
_log.warn(f'Tried to remove nonexistent notification handler {id} from device {self}.') _log.info(f'Tried to remove nonexistent notification handler {id} from device {self}.')
else: else:
del self._notification_handlers[id] del self._notification_handlers[id]