Merge pull request #255 from henryhyn/feat/log_config

feat: 配置日志打印文件及行号
This commit is contained in:
程序员阿江-Relakkes 2024-04-27 13:18:13 +08:00 committed by GitHub
commit 237d5be894
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -9,8 +9,8 @@ def init_loging_config():
level = logging.INFO
logging.basicConfig(
level=level,
format="%(asctime)s %(name)s %(levelname)s %(message)s ",
datefmt='%Y-%m-%d %H:%M:%S'
format="%(asctime)s [%(threadName)s] %(name)s %(levelname)s (%(filename)s:%(lineno)d) - %(message)s",
datefmt='%Y-%m-%d %H:%M:%S'
)
_logger = logging.getLogger("MediaCrawler")
_logger.setLevel(level)