diff --git a/pyproject.toml b/pyproject.toml index e5dceea..996d18c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voicemeeter-api" -version = "0.8.0" +version = "0.8.1" description = "A Python wrapper for the Voiceemeter API" authors = ["onyx-and-iris "] license = "MIT" diff --git a/voicemeeterlib/subject.py b/voicemeeterlib/subject.py index 2638ce0..fdca696 100644 --- a/voicemeeterlib/subject.py +++ b/voicemeeterlib/subject.py @@ -1,6 +1,11 @@ +import logging + + class Subject: """Adds support for observers""" + logger = logging.getLogger("subject.subject") + def __init__(self): """list of current observers""" @@ -22,16 +27,22 @@ class Subject: if observer not in self._observers: self._observers.append(observer) + self.logger.info(f"{type(observer).__name__} added to event observers") else: - print(f"Failed to add: {observer}") + self.logger.error( + f"Failed to add {type(observer).__name__} to event observers" + ) def remove(self, observer): """removes an observer from _observers""" try: self._observers.remove(observer) + self.logger.info(f"{type(observer).__name__} removed from event observers") except ValueError: - print(f"Failed to remove: {observer}") + self.logger.error( + f"Failed to remove {type(observer).__name__} from event observers" + ) def clear(self): """clears the _observers list"""