import logging logging.basicConfig(filename='test.log', level=logging.DEBUG)