Skip to content

feat: Using logging instead of `print()`

stephen requested to merge implement-logging into main

In several places within this codebase, print() is used to print errors to the Python console. This would be better accomplished with the logging module, as it is designed to actually log to file the messages it prints to console, and can do so with respect to different contexts or severities, et al.

This commit, therefore, imports logging wherever print() is being used, defines a new logger using the current module's __name__, and replaces each instance of print() with logger.error(). (Only error- level issues were being print()ed to console, so no need for logger.info() or other non-error levels of logging yet.)

Merge request reports