logging module now used to log interface events.

register, deregister method aliases added to Subject class.
This commit is contained in:
onyx-and-iris
2022-09-28 18:13:07 +01:00
parent db96872965
commit 23bc15e437
5 changed files with 38 additions and 8 deletions

View File

@@ -1,15 +1,16 @@
import logging
from abc import abstractmethod
from enum import IntEnum
from functools import cached_property
from typing import Iterable, NoReturn
from .base import VbanCmd
from .bus import request_bus_obj as bus
from .command import Command
from .config import request_config as configs
from .kinds import KindMapClass
from .kinds import request_kind_map as kindmap
from .strip import request_strip_obj as strip
from .vbancmd import VbanCmd
class FactoryBuilder:
@@ -19,6 +20,7 @@ class FactoryBuilder:
Separates construction from representation.
"""
logger = logging.getLogger("vbancmd.factorybuilder")
BuilderProgress = IntEnum("BuilderProgress", "strip bus command", start=0)
def __init__(self, factory, kind: KindMapClass):
@@ -33,7 +35,7 @@ class FactoryBuilder:
def _pinfo(self, name: str) -> NoReturn:
"""prints progress status for each step"""
name = name.split("_")[1]
print(self._info[int(getattr(self.BuilderProgress, name))])
self.logger.info(self._info[int(getattr(self.BuilderProgress, name))])
def make_strip(self):
self._factory.strip = tuple(