Python 3 logging setup

Doing a few things here: Showing log output in the console Writing log output to a file Set logger level import logging LOG_FILE = “your_log_file.log” logger = logging.getLogger(__name__) # Set up console handler for logging ch = logging.StreamHandler() # Set up file handler for logging fh = logging.FileHandler(LOG_FILE) # Make the log messages look nice…

Continue Reading