Merge pull request #29 from onyx-and-iris/dev

added module level loggers.
This commit is contained in:
Adem 2023-06-23 00:26:30 +03:00 committed by GitHub
commit 24f8487d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View File

@ -11,11 +11,12 @@ from websocket import WebSocketTimeoutException
from .error import OBSSDKError, OBSSDKTimeoutError
logger = logging.getLogger(__name__)
class ObsClient:
logger = logging.getLogger("baseclient.obsclient")
def __init__(self, **kwargs):
self.logger = logger.getChild(self.__class__.__name__)
defaultkwargs = {
"host": "localhost",
"port": 4455,

View File

@ -16,12 +16,14 @@ defined in official github repo
https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#events
"""
logger = logging.getLogger(__name__)
class EventClient:
logger = logging.getLogger("events.eventclient")
DELAY = 0.001
def __init__(self, **kwargs):
self.logger = logger.getChild(self.__class__.__name__)
defaultkwargs = {"subs": Subs.LOW_VOLUME}
kwargs = defaultkwargs | kwargs
self.base_client = ObsClient(**kwargs)

View File

@ -10,11 +10,12 @@ defined in official github repo
https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#Requests
"""
logger = logging.getLogger(__name__)
class ReqClient:
logger = logging.getLogger("reqs.reqclient")
def __init__(self, **kwargs):
self.logger = logger.getChild(self.__class__.__name__)
self.base_client = ObsClient(**kwargs)
if self.base_client.authenticate():
self.logger.info(f"Successfully identified {self} with the server")

View File

@ -1 +1 @@
version = "1.5.0"
version = "1.5.1"