You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- import logging
- import sys
-
-
- def _get_logger():
- log = logging.getLogger('log')
- log.setLevel(logging.INFO)
- console_handle = logging.StreamHandler(sys.stdout)
- console_handle.setFormatter(logging.Formatter('[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d] - %(message)s',
- datefmt='%Y-%m-%d %H:%M:%S'))
- log.addHandler(console_handle)
- return log
-
-
- # 日志句柄
- logger = _get_logger()
|