Set logger to 'aiogram'

This commit is contained in:
AndrewKing 2021-03-20 20:18:20 +02:00
parent 3d878a99d2
commit a7e654c365
No known key found for this signature in database
GPG key ID: D332A306AAA27181

View file

@ -1,8 +1,8 @@
from __future__ import annotations from __future__ import annotations
import io import io
import logging
import typing import typing
from asyncio.log import logger
from typing import TypeVar from typing import TypeVar
from babel.support import LazyProxy from babel.support import LazyProxy
@ -27,6 +27,9 @@ Float = TypeVar('Float', bound=float)
Boolean = TypeVar('Boolean', bound=bool) Boolean = TypeVar('Boolean', bound=bool)
T = TypeVar('T') T = TypeVar('T')
# Main aiogram logger
log = logging.getLogger('aiogram')
class MetaTelegramObject(type): class MetaTelegramObject(type):
""" """
@ -228,7 +231,7 @@ class TelegramObject(ContextInstanceMixin, metaclass=MetaTelegramObject):
self.values[key] = value self.values[key] = value
# Log warning when Telegram silently adds new Fields # Log warning when Telegram silently adds new Fields
logger.warning(f"Field '{key}' doesn't exist in {self.__class__}") log.warning(f"Field '%s' doesn't exist in %s", key, self.__class__)
def __contains__(self, item: str) -> bool: def __contains__(self, item: str) -> bool:
""" """