Problem scenario
You have a Python program that displays urllib3 (or some other type) of message to the screen. You do not want them echoed there cluttering the screen. You want to redirect the output to a log file (to permanently store the data). How do you get a Python program to write to a log file?
Solution
Use these three lines, but replace "contint" with the name of your choice:
import logging
logging.basicConfig(filename='contint.log', filemode='a', level=logging.DEBUG)
logging.captureWarnings(True)