code-dumps/py/log-test.py

12 lines
277 B
Python
Raw Normal View History

2024-10-24 23:09:21 +08:00
#!/usr/bin/python3
import logging
logging.basicConfig(format='%(levelname)s: %(message)s',level=logging.DEBUG)
logging.debug('Debug message')
logging.info('Info message')
logging.warning('Warning message')
logging.error('Error message')
logging.critical('Critical message')