Commit 41e2a56417f5a1e9d5874a066e694ea72c30edf2

Authored by Christopher Stone
1 parent de93c0ff
Exists in master

Further work on logging: Improved log entry formatting

robots/little_john/telemetry/code/monitor/graph_plotter_rewrite.py
@@ -20,13 +20,14 @@ from serialselect import selectserial @@ -20,13 +20,14 @@ from serialselect import selectserial
20 20
21 from colours import * 21 from colours import *
22 22
23 -logging.basicConfig(level=logging.DEBUG) 23 +logging.basicConfig(format='%(levelname)s:\t%(message)s',
  24 + level=logging.DEBUG)
24 logging.info("Logging system active") 25 logging.info("Logging system active")
25 26
26 datafeed = selectserial() 27 datafeed = selectserial()
27 28
28 if type(datafeed) is str: 29 if type(datafeed) is str:
29 - message = "Failed to open serial port:\n" + datafeed 30 + message = "Failed to open serial port: " + datafeed
30 easygui.msgbox(message, "Fatal error") 31 easygui.msgbox(message, "Fatal error")
31 logging.critical(message) 32 logging.critical(message)
32 sys.exit() 33 sys.exit()