- better logging of drivers
git-svn-id: http://moon:8086/svn/projects/HendiControl@363 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import time
|
||||
import abc
|
||||
import logging
|
||||
|
||||
|
||||
class AStirrer(abc.ABC):
|
||||
@abc.abstractmethod
|
||||
def name(self):
|
||||
return ""
|
||||
|
||||
def __init__(self, dt):
|
||||
self.dt = dt
|
||||
self.speed = 0
|
||||
@@ -12,8 +16,8 @@ class AStirrer(abc.ABC):
|
||||
self.isOn = 1
|
||||
|
||||
def log(self, s):
|
||||
now = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
|
||||
print("{}: {}".format(now, s))
|
||||
d = {'user': self.name()}
|
||||
logging.info ("{}".format(s), extra=d)
|
||||
|
||||
def process(self):
|
||||
isOn = self.isOn
|
||||
|
||||
Reference in New Issue
Block a user