Skip to content
This repository was archived by the owner on Dec 24, 2018. It is now read-only.

Commit 97ed2df

Browse files
committed
use logging.error in except
1 parent 1eebbf8 commit 97ed2df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

weixin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def webwxsync(self):
362362
dic = self._post(url, params)
363363
if self.DEBUG:
364364
print json.dumps(dic, indent=4)
365-
logging.debug(json.dumps(dic, indent=4))
365+
(json.dumps(dic, indent=4))
366366

367367
if dic['BaseResponse']['Ret'] == 0:
368368
self.SyncKey = dic['SyncKey']
@@ -1031,14 +1031,14 @@ def _post(self, url, params, jsonfmt=True):
10311031
return json.loads(data, object_hook=_decode_dict)
10321032
return data
10331033
except urllib2.HTTPError, e:
1034-
checksLogger.error('HTTPError = ' + str(e.code))
1034+
logging.error('HTTPError = ' + str(e.code))
10351035
except urllib2.URLError, e:
1036-
checksLogger.error('URLError = ' + str(e.reason))
1036+
logging.error('URLError = ' + str(e.reason))
10371037
except httplib.HTTPException, e:
1038-
checksLogger.error('HTTPException')
1038+
logging.error('HTTPException')
10391039
except Exception:
10401040
import traceback
1041-
checksLogger.error('generic exception: ' + traceback.format_exc())
1041+
logging.error('generic exception: ' + traceback.format_exc())
10421042

10431043
return ''
10441044

0 commit comments

Comments
 (0)