cleaner-log4
All checks were successful
Deploy on push / deploy (push) Successful in 4m29s

This commit is contained in:
2025-09-29 08:15:15 +03:00
parent a0ab20f276
commit 327135c09b
2 changed files with 36 additions and 0 deletions

View File

@@ -52,6 +52,24 @@ def console_filter(record: logging.LogRecord) -> bool:
):
return False
# 🚫 Блокируем OAuth ошибки от ботов (GPTBot, crawlers)
if (
record.levelno == logging.ERROR
and "Missing OAuth state parameter" in message
and any(
bot_phrase in message
for bot_phrase in [
"GPTBot",
"gptbot",
"crawler",
"bot",
"spider",
"x-openai-host-hash",
]
)
):
return False
# Define `package` attribute with the relative path.
record.package = record.pathname[_leng_path + 1 :].replace(".py", "")
record.emoji = (