proper logging, add signal handler for graceful termination

This commit is contained in:
2025-05-23 13:52:42 +02:00
parent 04bf09ae5a
commit ef35d18f37
6 changed files with 52 additions and 39 deletions

View File

@ -1,4 +1,5 @@
import re
import logging
from ast import literal_eval
from streams import Stream
from secop import EnumConvert
@ -154,7 +155,7 @@ class NicosStream(Stream):
if self._init:
raise TimeoutError('timeout receiving initial values')
except Exception as e:
print(self.uri, repr(e))
logging.exception('nicos %r', self.uri)
return
for ts, devname, param, op, value in sorted([t, d, p, o, v] for (d, p), (o, v, t) in events.items()):
descr = self.descr.get(devname)