From 03c11d8169faaee477d514b01d7ff1fb96072e57 Mon Sep 17 00:00:00 2001 From: Hugo Stephens Date: Sat, 10 Mar 2018 19:43:37 +0000 Subject: [PATCH] improved (well i think so) logging display which should allow for easier debugging --- robots/little_john/telemetry/code/monitor/version1/main.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/robots/little_john/telemetry/code/monitor/version1/main.py b/robots/little_john/telemetry/code/monitor/version1/main.py index 9711e4e..03b7aea 100755 --- a/robots/little_john/telemetry/code/monitor/version1/main.py +++ b/robots/little_john/telemetry/code/monitor/version1/main.py @@ -20,7 +20,10 @@ from series import Series from plot import Plot from getdata import getData -logging.basicConfig(format='%(levelname)s:\t%(message)s', level=logging.DEBUG) +print(' Error: Module Function Message') +# WHY WON'T THIS PRINT AT THE TOP +format_string = '%(levelname)8s:\t%(module)-10s \t%(funcName)s \t%(message)s' +logging.basicConfig(format=format_string, level=logging.DEBUG) logging.info("Logging system active") starttime = time.time() @@ -31,19 +34,24 @@ if datafeed is None: sys.exit() if platform.system() == 'Windows': - os='Windows' + os = 'Windows' else: - os='Other' + os = 'Other' logging.info('OS = ' + os) +data_points_series_1 = 150 +data_points_series_2 = 150 -testseries = Series(points=150, xauto=True, ylimits=(0, 1024), +testseries = Series(points=data_points_series_1, xauto=True, + ylimits=(0, 1024), title="Data from serial (time)", xname="Time (s)", yname="ADC output") -testseries2 = Series(points=150, xlimits=(0, 1024), ylimits=(0, 1024), +logging.info('Series 1 has ' + str(data_points_series_1) + ' data points') +testseries2 = Series(points=data_points_series_2, xlimits=(0, 1024), + ylimits=(0, 1024), title="Data from serial (xy)", xname="ADC0 output", yname="ADC7 output") - +logging.info('Series 2 has ' + str(data_points_series_2) + ' data points') plots = [] plots.append(Plot(testseries)) plots.append(Plot(testseries2)) -- libgit2 0.21.2