Add Service and MqttSubscriber classes
- Create utils dir and move utils.py there
This commit is contained in:
17
motor_passo/utils/service.py
Normal file
17
motor_passo/utils/service.py
Normal 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()
|
||||
Reference in New Issue
Block a user