def logDataToTopic(self, level, code, data): log_data=Log() log_data.NodeID = 3 log_data.CodeID = code log_data.Level = level log_data.Text = data self.log_topic.publish(log_data)
def log_it(level, code, logMessage): logEntry = Log() logEntry.CodeID = code logEntry.NodeID = 2 logEntry.Text = logMessage pub_log.publish(logEntry)
def logDataToTopic(self, level, code, data): log_data = Log() log_data.NodeID = 3 log_data.CodeID = code log_data.Level = level log_data.Text = data self.log_topic.publish(log_data)
def publishToLog(level, code, logMessage): #-------------------publish list of bricks--------------------------------------------------------------------- #Node ID = 2 #level = 0 = debug, 1 = operation logEntry = Log() logEntry.CodeID = code logEntry.NodeID = 2 logEntry.Text = logMessage if level == "operation": logEntry.Level = 1 elif level == "debug": logEntry.Level = 0 else: print "Invalid loglevel:" print level return pubLog.publish(logEntry) return