diff --git a/pyproject.toml b/pyproject.toml index 40f5548..df414ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "xair-api" -version = "2.2.6" +version = "2.3.0" description = "Remote control Behringer X-Air | Midas MR mixers through OSC" authors = ["onyx-and-iris "] license = "MIT" diff --git a/xair_api/bus.py b/xair_api/bus.py index 1aec4c6..bf95aac 100644 --- a/xair_api/bus.py +++ b/xair_api/bus.py @@ -1,8 +1,11 @@ import abc +import logging from .meta import mute_prop from .shared import EQ, GEQ, Config, Dyn, Group, Insert, Mix +logger = logging.getLogger(__name__) + class IBus(abc.ABC): """Abstract Base Class for buses""" @@ -10,6 +13,7 @@ class IBus(abc.ABC): def __init__(self, remote, index: int): self._remote = remote self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str): return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/dca.py b/xair_api/dca.py index 6eca89c..952a1b3 100644 --- a/xair_api/dca.py +++ b/xair_api/dca.py @@ -1,4 +1,7 @@ import abc +import logging + +logger = logging.getLogger(__name__) class IDCA(abc.ABC): @@ -7,6 +10,7 @@ class IDCA(abc.ABC): def __init__(self, remote, index: int): self._remote = remote self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str) -> tuple: return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/fx.py b/xair_api/fx.py index 62705e9..298b04f 100644 --- a/xair_api/fx.py +++ b/xair_api/fx.py @@ -1,8 +1,11 @@ import abc +import logging from .meta import mute_prop from .shared import Config, Group, Mix +logger = logging.getLogger(__name__) + class IFX(abc.ABC): """Abstract Base Class for fxs""" @@ -10,6 +13,7 @@ class IFX(abc.ABC): def __init__(self, remote, index: int): self._remote = remote self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str): return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/lr.py b/xair_api/lr.py index 0c7d314..b9d75ea 100644 --- a/xair_api/lr.py +++ b/xair_api/lr.py @@ -1,9 +1,12 @@ import abc +import logging from typing import Optional from .meta import mute_prop from .shared import EQ, GEQ, Config, Dyn, Insert, Mix +logger = logging.getLogger(__name__) + class ILR(abc.ABC): """Abstract Base Class for lr""" @@ -12,6 +15,7 @@ class ILR(abc.ABC): self._remote = remote if index is not None: self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str): return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/rtn.py b/xair_api/rtn.py index 873a6be..512a09d 100644 --- a/xair_api/rtn.py +++ b/xair_api/rtn.py @@ -1,9 +1,12 @@ import abc +import logging from typing import Optional from .meta import mute_prop from .shared import EQ, Config, Group, Mix, Preamp, Send +logger = logging.getLogger(__name__) + class IRtn(abc.ABC): """Abstract Base Class for rtn""" @@ -12,6 +15,7 @@ class IRtn(abc.ABC): self._remote = remote if index is not None: self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str): return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/strip.py b/xair_api/strip.py index fe7199f..9d880c0 100644 --- a/xair_api/strip.py +++ b/xair_api/strip.py @@ -1,8 +1,11 @@ import abc +import logging from .meta import mute_prop from .shared import EQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp, Send +logger = logging.getLogger(__name__) + class IStrip(abc.ABC): """Abstract Base Class for strips""" @@ -10,6 +13,7 @@ class IStrip(abc.ABC): def __init__(self, remote, index: int): self._remote = remote self.index = index + 1 + self.logger = logger.getChild(self.__class__.__name__) def getter(self, param: str) -> tuple: return self._remote.query(f"{self.address}/{param}") diff --git a/xair_api/xair.py b/xair_api/xair.py index f374438..70dce67 100644 --- a/xair_api/xair.py +++ b/xair_api/xair.py @@ -25,6 +25,8 @@ from .lr import LR from .rtn import AuxRtn, FxRtn from .strip import Strip +logger = logging.getLogger(__name__) + class OSCClientServer(BlockingOSCUDPServer): def __init__(self, address: str, dispatcher: Dispatcher): @@ -45,8 +47,6 @@ class OSCClientServer(BlockingOSCUDPServer): class XAirRemote(abc.ABC): """Handles the communication with the mixer via the OSC protocol""" - logger = logging.getLogger("xair.xairremote") - _CONNECT_TIMEOUT = 0.5 _info_response = [] @@ -57,6 +57,7 @@ class XAirRemote(abc.ABC): self.xair_ip = kwargs["ip"] or self._ip_from_toml() self.xair_port = kwargs["port"] self._delay = kwargs["delay"] + self.logger = logger.getChild(self.__class__.__name__) if not self.xair_ip: raise XAirRemoteError("No valid ip detected") self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)