Fix-up missing loggers from f271316

This commit is contained in:
Lonami Exo
2019-01-12 12:15:29 +01:00
parent f271316d7d
commit ae4d4ba3ef
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -136,9 +136,9 @@ class Connection(abc.ABC):
pass
except Exception as e:
if isinstance(e, ConnectionError):
__log__.info('The server closed the connection while sending')
self._log.info('The server closed the connection while sending')
else:
__log__.exception('Unexpected exception in the send loop')
self._log.exception('Unexpected exception in the send loop')
self.disconnect()
+2 -2
View File
@@ -14,13 +14,13 @@ class MTProtoPlainSender:
MTProto Mobile Protocol plain sender
(https://core.telegram.org/mtproto/description#unencrypted-messages)
"""
def __init__(self, connection):
def __init__(self, connection, *, loggers):
"""
Initializes the MTProto plain sender.
:param connection: the Connection to be used.
"""
self._state = MTProtoState(auth_key=None)
self._state = MTProtoState(auth_key=None, loggers=loggers)
self._connection = connection
async def send(self, request):
+1 -1
View File
@@ -227,7 +227,7 @@ class MTProtoSender:
self._log.debug('Connection success!')
if not self.auth_key:
plain = MTProtoPlainSender(self._connection)
plain = MTProtoPlainSender(self._connection, loggers=self._loggers)
for retry in range(1, self._retries + 1):
try:
self._log.debug('New auth_key attempt {}...'.format(retry))