log.exception instead of log.error in callbacks
+ inhibit timestamps in future Change-Id: Idef463558bf24e891573179474ffbebd4e81468f
This commit is contained in:
parent
1de5455ef6
commit
0cbaffd4b6
@ -245,8 +245,10 @@ class ProxyClient:
|
|||||||
except UnregisterCallback:
|
except UnregisterCallback:
|
||||||
cblist.remove(cbfunc)
|
cblist.remove(cbfunc)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
# the programmer should catch all errors in callbacks
|
||||||
|
# if not, the log will be flooded with errors
|
||||||
if self.log:
|
if self.log:
|
||||||
self.log.error('error %r calling %s%r', e, cbfunc.__name__, args)
|
self.log.exception('error %r calling %s%r', e, cbfunc.__name__, args)
|
||||||
return bool(cblist)
|
return bool(cblist)
|
||||||
|
|
||||||
def updateValue(self, module, param, value, timestamp, readerror):
|
def updateValue(self, module, param, value, timestamp, readerror):
|
||||||
@ -398,6 +400,7 @@ class SecopClient(ProxyClient):
|
|||||||
value = data[0]
|
value = data[0]
|
||||||
readerror = None
|
readerror = None
|
||||||
module, param = module_param
|
module, param = module_param
|
||||||
|
timestamp = min(time.time(), timestamp) # no timestamps in the future!
|
||||||
try:
|
try:
|
||||||
self.updateValue(module, param, value, timestamp, readerror)
|
self.updateValue(module, param, value, timestamp, readerror)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user