nonebot2/none/log.py

17 lines
371 B
Python
Raw Normal View History

2018-07-21 00:46:34 +08:00
"""
Provide logger object.
Any other modules in "none" should use "logger" from this module
to log messages.
"""
2018-06-27 22:05:12 +08:00
import logging
2018-07-02 16:54:29 +08:00
import sys
2018-06-27 22:05:12 +08:00
logger = logging.getLogger('none')
default_handler = logging.StreamHandler(sys.stdout)
default_handler.setFormatter(logging.Formatter(
2018-07-21 21:59:51 +08:00
'[%(asctime)s %(name)s] %(levelname)s: %(message)s'
2018-06-27 22:05:12 +08:00
))
logger.addHandler(default_handler)