Python的log用法

import logging
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
------------------ 
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s')
logging.root.setLevel(level=logging.INFO)
logger.info("running %s" % ' '.join(sys.argv))

你可能感兴趣的:(Python的log用法)