diff --git a/obsws_python/events.py b/obsws_python/events.py index c4d0c8c..a2f07bc 100644 --- a/obsws_python/events.py +++ b/obsws_python/events.py @@ -43,10 +43,13 @@ class EventClient: kwargs = defaultkwargs | kwargs self.base_client = ObsClient(**kwargs) if self.base_client.authenticate(): - self.logger.info("Successfully identified client with the server") + self.logger.info(f"Successfully identified {self} with the server") self.callback = Callback() self.subscribe() + def __repr__(self): + return type(self).__name__ + def subscribe(self): worker = Thread(target=self.trigger, daemon=True) worker.start() diff --git a/obsws_python/reqs.py b/obsws_python/reqs.py index 3c98e50..7f15a35 100644 --- a/obsws_python/reqs.py +++ b/obsws_python/reqs.py @@ -17,7 +17,7 @@ class ReqClient: def __init__(self, **kwargs): self.base_client = ObsClient(**kwargs) if self.base_client.authenticate(): - self.logger.info("Successfully identified client with the server") + self.logger.info(f"Successfully identified {self} with the server") def __enter__(self): return self @@ -25,6 +25,9 @@ class ReqClient: def __exit__(self, exc_type, exc_value, exc_traceback): self.base_client.ws.close() + def __repr__(self): + return type(self).__name__ + def send(self, param, data=None): response = self.base_client.req(param, data) if not response["requestStatus"]["result"]: