Пример #1
0
 def emit(self, record):
   try:
     context = ctk.ctkErrorLogContext()
     context.setCategory(self.category)
     context.setLine(record.lineno)
     context.setFile(record.pathname)
     context.setFunction(record.funcName)
     context.setMessage(record.msg)
     threadId = "{0}({1})".format(record.threadName, record.thread)
     slicer.app.errorLogModel().addEntry(qt.QDateTime.currentDateTime(), threadId,
       self.pythonToCtkLevelConverter[record.levelno], self.origin, context, record.msg)
   except:
     self.handleError(record)
Пример #2
0
 def emit(self, record):
   try:
     msg = self.format(record)
     context = ctk.ctkErrorLogContext()
     context.setCategory(self.category)
     context.setLine(record.lineno)
     context.setFile(record.pathname)
     context.setFunction(record.funcName)
     context.setMessage(msg)
     threadId = "{0}({1})".format(record.threadName, record.thread)
     slicer.app.errorLogModel().addEntry(qt.QDateTime.currentDateTime(), threadId,
       self.pythonToCtkLevelConverter[record.levelno], self.origin, context, msg)
   except:
     self.handleError(record)