1.3 Новые уровни логгера (ФИКСИТЬ!!!)
This commit is contained in:
@@ -16,9 +16,15 @@ async def setup_logger() -> None:
|
||||
"""
|
||||
logger.remove() # Удаляем все логгеры
|
||||
|
||||
if BotLogs.permission or BotLogs.permission_to_file:
|
||||
if BotLogs.permission and BotLogs.permission_to_file:
|
||||
# Добавляем новый уровень START
|
||||
logger.level("START", no=25, color="white", icon="🔸")
|
||||
if BotLogs.permission and BotLogs.permission_new_user:
|
||||
# Добавляем новый уровень NEW_USER
|
||||
logger.level("NEW_USER", no=4, color="white", icon="👋")
|
||||
if BotLogs.permission and BotLogs.permission_leave_user:
|
||||
# Добавляем новый уровень LEAVE_USER
|
||||
logger.level("LEAVE_USER", no=3, color="white", icon="🫰")
|
||||
|
||||
# Настройка логирования в консоль для каждого уровня
|
||||
if BotLogs.permission:
|
||||
|
||||
@@ -13,9 +13,18 @@ class BotLogs:
|
||||
permission_to_file: bool = Permissions.logging_to_file
|
||||
permission_msg: bool = Permissions.msg_logging
|
||||
|
||||
permission_new_user: bool = Permissions.new_user
|
||||
permission_leave_user: bool = Permissions.leave_user
|
||||
|
||||
# Максимальный размер лог-файла
|
||||
max_size: str = "500 MB"
|
||||
|
||||
# Шаблон логов для отладки
|
||||
new_user_text: str = (
|
||||
"<cyan>{time:YYYY-MM-DD HH:mm:ss}</cyan> <red>|</red> "
|
||||
"<magenta>{extra[system]}-{extra[log_type]}</magenta> <red>|</red> "
|
||||
"<yellow>{extra[user]}</yellow> <red>|</red> <level>{message}</level>"
|
||||
)
|
||||
|
||||
# Шаблон логов для старта
|
||||
start_text: str = (
|
||||
|
||||
Reference in New Issue
Block a user