From: jamesbunton Date: Wed, 12 Jul 2006 06:50:22 +0000 (+0000) Subject: Turned off MSN protocol debugging by default. X-Git-Url: https://code.delx.au/pymsnt/commitdiff_plain/89a1109f8981cd7ff33f9ce2d974b712c9c4bb6c Turned off MSN protocol debugging by default. Added a level 4 debug log to dump the MSN protocol. Fixed debugging to not print duplicates after SIGHUP Updated config-example.xml git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@191 55fbd22a-6204-0410-b2f0-b6c764c7e90a committer: jamesbunton --- diff --git a/config-example.xml b/config-example.xml index ed35fa2..2953474 100644 --- a/config-example.xml +++ b/config-example.xml @@ -20,7 +20,7 @@ Do not include the jid of the transport --> PyMSNt.pid - + @@ -80,7 +80,9 @@ Do not include the jid of the transport --> 0 -> No logging 1 -> Log tracebacks 2 -> Log tracebacks, warnings and errors -3 -> Log everything --> +3 -> Log all sorts of informational (mostly useless stuff) +4 -> Log the MSN protocol code sent +--> diff --git a/src/debug.py b/src/debug.py index 0f90522..74c52cb 100644 --- a/src/debug.py +++ b/src/debug.py @@ -47,6 +47,7 @@ def printf(text): sys.__stdout__.write(text + "\n") sys.__stdout__.flush() + debugFile = None def reloadConfig(): global debugFile @@ -71,6 +72,10 @@ def reloadConfig(): else: debugFile = sys.__stdout__ + try: + log.removeObserver(observer) + except ValueError: + pass log.startLoggingWithObserver(observer) else: log.discardLogs() diff --git a/src/legacy/glue.py b/src/legacy/glue.py index 57280d2..e1017f4 100644 --- a/src/legacy/glue.py +++ b/src/legacy/glue.py @@ -36,6 +36,7 @@ defaultAvatar = avatar.AvatarCache().setAvatar(defaultAvatarData) def reloadConfig(): msn.MSNConnection.GETALLAVATARS = config.getAllAvatars + msn.DEBUGALL = config._debugLevel >= 4 def isGroupJID(jid): """ Returns True if the JID passed is a valid groupchat JID (for MSN, does not contain '%') """ diff --git a/src/tlib/msn/__init__.py b/src/tlib/msn/__init__.py index edc622a..d06450f 100644 --- a/src/tlib/msn/__init__.py +++ b/src/tlib/msn/__init__.py @@ -2,3 +2,4 @@ from msnw import MSNConnection, MultiSwitchboardSession from msn import FORWARD_LIST, ALLOW_LIST, BLOCK_LIST, REVERSE_LIST, PENDING_LIST from msn import STATUS_ONLINE, STATUS_OFFLINE, STATUS_HIDDEN, STATUS_IDLE, STATUS_AWAY, STATUS_BUSY, STATUS_BRB, STATUS_PHONE, STATUS_LUNCH from msn import MSNContact, MSNContactList +from msn import DEBUGALL diff --git a/src/tlib/msn/msn.py b/src/tlib/msn/msn.py index 6b5376f..ac4cb55 100644 --- a/src/tlib/msn/msn.py +++ b/src/tlib/msn/msn.py @@ -154,7 +154,7 @@ STATUS_LUNCH = 'LUN' PINGSPEED = 50.0 -DEBUGALL = True +DEBUGALL = False LINEDEBUG = False MESSAGEDEBUG = False MSNP2PDEBUG = False