瀏覽代碼

fix: add more log in itchat

master
lanvent 1 年之前
父節點
當前提交
be258e5b05
共有 2 個檔案被更改,包括 3 行新增2 行删除
  1. +2
    -1
      lib/itchat/components/login.py
  2. +1
    -1
      lib/itchat/components/register.py

+ 2
- 1
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)


+ 1
- 1
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)


Loading…
取消
儲存