From be258e5b0594d894268d7d32743a6b64546b1cf9 Mon Sep 17 00:00:00 2001 From: lanvent Date: Thu, 27 Apr 2023 11:23:28 +0800 Subject: [PATCH] fix: add more log in itchat --- lib/itchat/components/login.py | 3 ++- lib/itchat/components/register.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/itchat/components/login.py b/lib/itchat/components/login.py index e4ec9ca..a2dd17c 100644 --- a/lib/itchat/components/login.py +++ b/lib/itchat/components/login.py @@ -43,6 +43,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, logger.warning('itchat has already logged in.') return self.isLogging = True + logger.info('Ready to login.') while self.isLogging: uuid = push_login(self) if uuid: @@ -84,7 +85,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, if hasattr(loginCallback, '__call__'): r = loginCallback() else: - utils.clear_screen() + # utils.clear_screen() if os.path.exists(picDir or config.DEFAULT_QR): os.remove(picDir or config.DEFAULT_QR) logger.info('Login successfully as %s' % self.storageClass.nickName) diff --git a/lib/itchat/components/register.py b/lib/itchat/components/register.py index 368ac31..b8bbc29 100644 --- a/lib/itchat/components/register.py +++ b/lib/itchat/components/register.py @@ -28,7 +28,7 @@ def auto_login(self, hotReload=False, statusStorageDir='itchat.pkl', if rval:=self.load_login_status(statusStorageDir, loginCallback=loginCallback, exitCallback=exitCallback): return - logger.error('hot reload failed, logging in normally, {}'.format(rval)) + logger.error('Hot reload failed, logging in normally, error={}'.format(rval)) self.logout() self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, loginCallback=loginCallback, exitCallback=exitCallback)