This just has two functions, a get_logger function that returns the logger object and a set_logging_level function that changes the log level of the logger;
Since the logic for this was so simple I removed the logging folder with __init__.py inside and just created a logging.py file, but let me know if I should change that;
Changed the verbose_print's and print's to use the logger instead (In the Spider class and in fetch_url);
Removed the verbose_print method of Spider. Instead, the log level of the logger is set according to the verbose argument: True -> DEBUGFalse -> INFO;
Replaced capsys with caplog in the tests so that they work with the log output instead of stdout;
Closes #38
Changes
logging
submodule inlogging.py
;get_logger
function that returns the logger object and aset_logging_level
function that changes the log level of the logger;logging
folder with__init__.py
inside and just created alogging.py
file, but let me know if I should change that;verbose_print
's andprint
's to use the logger instead (In theSpider
class and infetch_url
);verbose_print
method ofSpider
. Instead, the log level of the logger is set according to the verbose argument:True -> DEBUG
False -> INFO
;capsys
withcaplog
in the tests so that they work with the log output instead of stdout;