Commit 03c11d8169faaee477d514b01d7ff1fb96072e57
1 parent
7ec76bff
Exists in
master
improved (well i think so) logging display which should allow for easier debugging
Showing
1 changed file
with
14 additions
and
6 deletions
Show diff stats
robots/little_john/telemetry/code/monitor/version1/main.py
... | ... | @@ -20,7 +20,10 @@ from series import Series |
20 | 20 | from plot import Plot |
21 | 21 | from getdata import getData |
22 | 22 | |
23 | -logging.basicConfig(format='%(levelname)s:\t%(message)s', level=logging.DEBUG) | |
23 | +print(' Error: Module Function Message') | |
24 | +# WHY WON'T THIS PRINT AT THE TOP | |
25 | +format_string = '%(levelname)8s:\t%(module)-10s \t%(funcName)s \t%(message)s' | |
26 | +logging.basicConfig(format=format_string, level=logging.DEBUG) | |
24 | 27 | logging.info("Logging system active") |
25 | 28 | starttime = time.time() |
26 | 29 | |
... | ... | @@ -31,19 +34,24 @@ if datafeed is None: |
31 | 34 | sys.exit() |
32 | 35 | |
33 | 36 | if platform.system() == 'Windows': |
34 | - os='Windows' | |
37 | + os = 'Windows' | |
35 | 38 | else: |
36 | - os='Other' | |
39 | + os = 'Other' | |
37 | 40 | logging.info('OS = ' + os) |
38 | 41 | |
42 | +data_points_series_1 = 150 | |
43 | +data_points_series_2 = 150 | |
39 | 44 | |
40 | -testseries = Series(points=150, xauto=True, ylimits=(0, 1024), | |
45 | +testseries = Series(points=data_points_series_1, xauto=True, | |
46 | + ylimits=(0, 1024), | |
41 | 47 | title="Data from serial (time)", |
42 | 48 | xname="Time (s)", yname="ADC output") |
43 | -testseries2 = Series(points=150, xlimits=(0, 1024), ylimits=(0, 1024), | |
49 | +logging.info('Series 1 has ' + str(data_points_series_1) + ' data points') | |
50 | +testseries2 = Series(points=data_points_series_2, xlimits=(0, 1024), | |
51 | + ylimits=(0, 1024), | |
44 | 52 | title="Data from serial (xy)", |
45 | 53 | xname="ADC0 output", yname="ADC7 output") |
46 | - | |
54 | +logging.info('Series 2 has ' + str(data_points_series_2) + ' data points') | |
47 | 55 | plots = [] |
48 | 56 | plots.append(Plot(testseries)) |
49 | 57 | plots.append(Plot(testseries2)) | ... | ... |