1logging.basicConfig(filename="logfilename.log", level=logging.INFO)
2# Log Creation
3
4logging.info('your text goes here')
5logging.error('your text goes here')
6logging.debug('your text goes here')
7
1import logging
2logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
3logging.debug('This message should go to the log file')
4logging.info('So should this')
5logging.warning('And this, too')
6logging.error('And non-ASCII stuff, too, like Øresund and Malmö')
7