From 431a983d5b66522604f0685ef078d40735cea64c Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 21 Feb 2019 21:18:53 +0300 Subject: [PATCH] Fix logging and cleanup imports in client.py --- pyrogram/client/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 9a9f8482..0e8d5554 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -16,9 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -import base64 import binascii -import json import logging import math import mimetypes @@ -1105,7 +1103,10 @@ class Client(Methods, BaseClient): try: self.session_storage.load_session(self.session_name) except SessionDoesNotExist: - log.info('Session {} was not found, initializing new one') + session_name = self.session_name[:32] + if session_name != self.session_name: + session_name += '...' + log.info('Could not load session "{}", initializing new one'.format(self.session_name)) self.auth_key = Auth(self.dc_id, self.test_mode, self.ipv6, self._proxy).create() def load_plugins(self):