1import logging
2logging.basicConfig(
3 format='%(asctime)s %(levelname)-8s %(message)s',
4 level=logging.INFO,
5 datefmt='%Y-%m-%d %H:%M:%S')
6
7logging.info('an info messge')
8# 2017-05-25 00:58:28 INFO an info messge
9logging.debug('a debug messag is not shown')