Skip to content
Snippets Groups Projects
Commit 6cce02e3 authored by Torben Petersen's avatar Torben Petersen
Browse files

Adds Master-Log where all sent Commands are logged

parent 7b5ffe77
No related branches found
No related tags found
No related merge requests found
......@@ -358,13 +358,17 @@ class PRREvalClient(Thread):
else:
self.client_two.publish(tx_topic, bytes(line, 'utf-8'), qos=2)
fh = logging.FileHandler("{}.log".format(id))
fh = logging.FileHandler("Node-Logs/master-log.log")
fh.setLevel(logging.DEBUG)
fh.setFormatter(self.file_formatter)
self.log_mutex.acquire()
self.logger.addHandler(fh)
self.logger.info("{}\tcommand: {}".format(time(), line))
self.logger.info("{}\t sending command to {:>30}: {}".format(time(), node_id, line))
self.logger.removeHandler(fh)
self.log_mutex.release()
pass
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment