verion which did not include the handling in RTService wth creating the
Json file
This commit is contained in:
34
vrpmdvserver/vrpmdvlogging.py
Normal file
34
vrpmdvserver/vrpmdvlogging.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from extensions.rt_service import rt_service as rts
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
|
||||
|
||||
def thread_function(name):
|
||||
|
||||
logging.info("Thread %s: starting", name)
|
||||
rtserv = rts.RT_Service()
|
||||
isok = rtserv.initLogChannel()
|
||||
if (not isok):
|
||||
logging.info("Thread %s: could not open the logport", name)
|
||||
|
||||
while (isok):
|
||||
msg = rtserv.readLogChannel()
|
||||
logging.info(msg)
|
||||
if (msg == 'noResult'):
|
||||
break
|
||||
|
||||
logging.info("Thread %s: finishing", name)
|
||||
|
||||
|
||||
|
||||
def createCoproLoggingTask():
|
||||
format = "%(asctime)s: %(message)s"
|
||||
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
|
||||
x = threading.Thread(target=thread_function, args=(1,))
|
||||
|
||||
x.start()
|
||||
return x
|
||||
|
||||
Reference in New Issue
Block a user