feat: 配置日志打印文件及行号

This commit is contained in:
Henry He 2024-04-27 12:11:42 +08:00
parent 2d051cc670
commit 0a95b7d30b
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)