- better logging of drivers

git-svn-id: http://moon:8086/svn/projects/HendiControl@363 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2020-04-19 16:05:53 +00:00
parent b51e2c222d
commit 95afea668f
6 changed files with 48 additions and 22 deletions
+6 -4
View File
@@ -1,13 +1,15 @@
import time
import abc
import logging
class ATemperatureSensor(abc.ABC):
def __init__(self, name):
self.name
def log(self, s):
d = {'user': self.name()}
logging.info ("{}".format(s), extra=d)
@abc.abstractmethod
def name(self):
return self.name
return ""
@abc.abstractmethod
def temperature(self):