Commit 41e2a56417f5a1e9d5874a066e694ea72c30edf2
1 parent
de93c0ff
Exists in
master
Further work on logging: Improved log entry formatting
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
robots/little_john/telemetry/code/monitor/graph_plotter_rewrite.py
| ... | ... | @@ -20,13 +20,14 @@ from serialselect import selectserial |
| 20 | 20 | |
| 21 | 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 | 25 | logging.info("Logging system active") |
| 25 | 26 | |
| 26 | 27 | datafeed = selectserial() |
| 27 | 28 | |
| 28 | 29 | if type(datafeed) is str: |
| 29 | - message = "Failed to open serial port:\n" + datafeed | |
| 30 | + message = "Failed to open serial port: " + datafeed | |
| 30 | 31 | easygui.msgbox(message, "Fatal error") |
| 31 | 32 | logging.critical(message) |
| 32 | 33 | sys.exit() | ... | ... |