Add Service and MqttSubscriber classes

- Create utils dir and move utils.py there
This commit is contained in:
2023-10-29 20:56:03 -03:00
parent 7df3639923
commit e0422f066b
6 changed files with 84 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import threading
import logging
class Service(threading.Thread):
def __init__(self, name: str = "(sem nome)"):
super().__init__()
log = logging.getLogger(__name__).getChild(self.__class__.__name__)
self.daemon = True
self.name = name
self._l = log.getChild(self.name)
def start(self) -> None:
self._l.debug(f"Iniciando serviço {self.name}")
super().start()