perf(logging): optimize logging with rotation, async I/O, and lazy formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Estrella Pan
2026-02-22 14:10:56 +01:00
parent c173454a67
commit 5f604e94fd
39 changed files with 198 additions and 116 deletions

View File

@@ -34,7 +34,7 @@ class TitleParser:
async def tmdb_parser(title: str, season: int, language: str):
tmdb_info = await tmdb_parser(title, language)
if tmdb_info:
logger.debug(f"TMDB Matched, official title is {tmdb_info.title}")
logger.debug("TMDB Matched, official title is %s", tmdb_info.title)
tmdb_season = tmdb_info.last_season if tmdb_info.last_season else season
return tmdb_info.title, tmdb_season, tmdb_info.year, tmdb_info.poster_link
else:
@@ -48,7 +48,7 @@ class TitleParser:
bangumi.official_title, settings.rss_parser.language
)
if tmdb_info:
logger.debug(f"TMDB Matched, official title is {tmdb_info.title}")
logger.debug("TMDB Matched, official title is %s", tmdb_info.title)
bangumi.poster_link = tmdb_info.poster_link
else:
logger.warning(
@@ -86,7 +86,7 @@ class TitleParser:
else:
official_title = title_raw
_season = episode.season
logger.debug(f"RAW:{raw} >> {title_raw}")
logger.debug("RAW:%s >> %s", raw, title_raw)
return Bangumi(
official_title=official_title,
title_raw=title_raw,