improve debug

This commit is contained in:
chrys 2017-05-09 23:27:13 +02:00
parent c351dbe00b
commit cebdadf54d
2 changed files with 4 additions and 4 deletions

View File

@ -204,10 +204,10 @@ class settingsManager():
os.path.dirname(os.path.realpath(__main__.__file__)) + "/" + driverType + '/' + driverName + '.py') os.path.dirname(os.path.realpath(__main__.__file__)) + "/" + driverType + '/' + driverName + '.py')
self.env['runtime'][driverType] = driver_mod.driver() self.env['runtime'][driverType] = driver_mod.driver()
self.env['runtime'][driverType].initialize(self.env) self.env['runtime'][driverType].initialize(self.env)
self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType +" OK",debug.debugLevel.INFO, onAnyLevel=True) self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") OK",debug.debugLevel.INFO, onAnyLevel=True)
except Exception as e: except Exception as e:
self.env['runtime'][driverType] = None self.env['runtime'][driverType] = None
self.env['runtime']['debug'].writeDebugOut("Loading " + driverType + " Driver : "+ str(e), debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") FAILED:"+ str(e), debug.debugLevel.ERROR)
def shutdownDriver(self, driverType): def shutdownDriver(self, driverType):
if self.env['runtime'][driverType] == None: if self.env['runtime'][driverType] == None:
return return

View File

@ -80,11 +80,11 @@ class driver():
try: try:
self.proc.terminate() self.proc.terminate()
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.terminate():' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.terminate():' + str(e),debug.debugLevel.WARNING)
try: try:
self.proc.kill() self.proc.kill()
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.kill():' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.kill():' + str(e),debug.debugLevel.WARNING)
self.proc = None self.proc = None
self.lock.release() self.lock.release()
def setCallback(self, callback): def setCallback(self, callback):