fix logging

This commit is contained in:
Vladless
2024-11-15 23:15:19 +03:00
parent e2796d22e2
commit 0be6ed0631
3 changed files with 16 additions and 23 deletions
+1 -1
View File
@@ -12,9 +12,9 @@ router = Router()
from handlers import commands, coupons, donate, notifications, pay, profile, start
from handlers.admin import admin_commands, admin_coupons, admin_panel, admin_user_editor
from handlers.instructions import instructions
from handlers.keys import key_management, keys
from handlers.payments import cryprobot_pay, freekassa_pay, robokassa_pay, stars_pay, yookassa_pay
from handlers.instructions import instructions
dp.include_router(admin_commands.router)
dp.include_router(admin_coupons.router)
+10 -17
View File
@@ -1,16 +1,16 @@
import os
from aiogram import types
from aiogram.types import BufferedInputFile, InlineKeyboardButton, InlineKeyboardMarkup
from handlers.texts import INSTRUCTIONS
from bot import bot
from aiogram import F, Router, types
from config import SUPPORT_CHAT_URL, CONNECT_WINDOWS
from aiogram.types import BufferedInputFile, InlineKeyboardButton, InlineKeyboardMarkup
from loguru import logger
from handlers.texts import KEY_MESSAGE, INSTRUCTION_PC
from bot import bot
from config import CONNECT_WINDOWS, SUPPORT_CHAT_URL
from handlers.texts import INSTRUCTION_PC, INSTRUCTIONS, KEY_MESSAGE
router = Router()
async def send_instructions(callback_query: types.CallbackQuery):
await callback_query.message.delete()
@@ -67,18 +67,11 @@ async def process_connect_pc(callback_query: types.CallbackQuery):
text="🔙 Назад в профиль", callback_data="view_profile"
)
inline_keyboard = [
[connect_windows_button],
[support_button],
[back_button]
]
inline_keyboard = [[connect_windows_button], [support_button], [back_button]]
keyboard = types.InlineKeyboardMarkup(inline_keyboard=inline_keyboard)
await bot.send_message(
tg_id,
instruction_message,
reply_markup=keyboard,
parse_mode="HTML"
tg_id, instruction_message, reply_markup=keyboard, parse_mode="HTML"
)
await callback_query.answer()
await callback_query.answer()
+5 -5
View File
@@ -38,11 +38,11 @@ class LoggingMiddleware(BaseMiddleware):
class InterceptHandler(logging.Handler):
def emit(self, record):
level = (
logger.level(record.levelname).name
if logger.level(record.levelname)
else record.levelno
)
try:
level = logger.level(record.levelname).name
except ValueError:
level = "INFO"
logger.log(level, record.getMessage())