Skip to content

Fix logging issues by adding handler code

Adithya Venkateswaran requested to merge bugfix/logging into master

Addresses issue #3 (closed)

Absence of a handler prevented the logs from being printed while called from inside other modules or in the terminal. This has been fixed.

How can I test?

> python sample_script.py

2020-07-30 20:21:54,544 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - No final_date specified, assuming 2020-07-30T20:21:54.544503
2020-07-30 20:21:54,544 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - No start_date specified, assuming 2019-08-29T20:21:54.544503
2020-07-30 20:21:54,544 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Attempt number: 1 to fetch indices
2020-07-30 20:21:58,910 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - 230 Anonymous access granted, restrictions apply
2020-07-30 20:21:59,320 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2019 at /tmp/2019Q1_DGD.txt
2020-07-30 20:22:01,163 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2019 at /tmp/2019Q2_DGD.txt
2020-07-30 20:22:03,826 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2019 at /tmp/2019Q3_DGD.txt
2020-07-30 20:22:06,078 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2019 at /tmp/2019Q4_DGD.txt
2020-07-30 20:22:08,332 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2020 at /tmp/2020Q1_DGD.txt
2020-07-30 20:22:10,632 - vinvelivaanilai.space_weather.sw_file_fetch - INFO - Fetching for: 2020 at /tmp/2020Q2_DGD.txt
2020-07-30 20:22:13,451 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2019Q1_DGD.txt
2020-07-30 20:22:13,641 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2019Q2_DGD.txt
2020-07-30 20:22:13,664 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2019Q3_DGD.txt
2020-07-30 20:22:13,693 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2019Q4_DGD.txt
2020-07-30 20:22:13,728 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2020Q1_DGD.txt
2020-07-30 20:22:13,783 - vinvelivaanilai.space_weather.sw_extractor - INFO - Extracting data from /tmp/2020Q2_DGD.txt
            Fredericksburg A  Fredericksburg K 0-3  Fredericksburg K 3-6  ...  Planetary K 15-18  Planetary K 18-21  Planetary K 21-24
Date                                                                      ...                                                         
2019-01-01               5.0                   1.0                   1.0  ...                  1                  0                  1
2019-01-02               1.0                   0.0                   0.0  ...                  1                  0                  1
2019-01-03               2.0                   1.0                   0.0  ...                  0                  0                  1
2019-01-04               7.0                   1.0                   1.0  ...                  3                  3                  3
2019-01-05              11.0                   4.0                   3.0  ...                  2                  2                  3
...                      ...                   ...                   ...  ...                ...                ...                ...
2020-06-26               6.0                   2.0                   0.0  ...                  1                  2                  3
2020-06-27               6.0                   2.0                   1.0  ...                  1                  1                  2
2020-06-28               4.0                   2.0                   2.0  ...                  1                  1                  1
2020-06-29               4.0                   1.0                   1.0  ...                  1                  1                  0
2020-06-30               5.0                   2.0                   2.0  ...                  1                  0                  2

[547 rows x 27 columns]

sample_script.py

Signed-off-by: Adithya Venkateswaran adithyav1511@gmail.com

Edited by Adithya Venkateswaran

Merge request reports