]> code.delx.au - pymsnt/commitdiff
Turned off MSN protocol debugging by default.
authorjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Wed, 12 Jul 2006 06:50:22 +0000 (06:50 +0000)
committerjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Wed, 12 Jul 2006 06:50:22 +0000 (06:50 +0000)
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 <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>

config-example.xml
src/debug.py
src/legacy/glue.py
src/tlib/msn/__init__.py
src/tlib/msn/msn.py

index ed35fa24869705900db04d87d768f2223cf03cbe..29534744fcdc155b78a5e5056d78780492f4fb95 100644 (file)
@@ -20,7 +20,7 @@ Do not include the jid of the transport -->
 <pid>PyMSNt.pid</pid>
 <!-- If set, the transport will background itself when run -->
 <background/>
 <pid>PyMSNt.pid</pid>
 <!-- If set, the transport will background itself when run -->
 <background/>
-<!-- The Twisted reactor to choose. Pick poll or epoll on Linux, kqueue on BSD. Or leave as default (select) -->
+<!-- The Twisted reactor to choose. Pick poll or epoll on Linux, kqueue on BSD. Or leave as default (best found) -->
 <!-- <reactor>poll</reactor> -->
 
 
 <!-- <reactor>poll</reactor> -->
 
 
@@ -80,7 +80,9 @@ Do not include the jid of the transport -->
 0 -> No logging
 1 -> Log tracebacks
 2 -> Log tracebacks, warnings and errors
 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
+-->
 <!-- <debugLevel>0</debugLevel> -->
 
 <!-- The file to log to. Leave this disabled for stdout -->
 <!-- <debugLevel>0</debugLevel> -->
 
 <!-- The file to log to. Leave this disabled for stdout -->
index 0f90522e631b8e37bb2c8be0ef7eb076bdbc4ffd..74c52cbe10b281c443ebb166ea6a3496771304a1 100644 (file)
@@ -47,6 +47,7 @@ def printf(text):
        sys.__stdout__.write(text + "\n")
        sys.__stdout__.flush()
 
        sys.__stdout__.write(text + "\n")
        sys.__stdout__.flush()
 
+
 debugFile = None
 def reloadConfig():
        global debugFile
 debugFile = None
 def reloadConfig():
        global debugFile
@@ -71,6 +72,10 @@ def reloadConfig():
                else:
                        debugFile = sys.__stdout__
 
                else:
                        debugFile = sys.__stdout__
 
+               try:
+                       log.removeObserver(observer)
+               except ValueError:
+                       pass
                log.startLoggingWithObserver(observer)
        else:
                log.discardLogs()
                log.startLoggingWithObserver(observer)
        else:
                log.discardLogs()
index 57280d266f19993788bee14d2e5946cb75e30aaa..e1017f4f2a6adb11c7a36340348197df16a90909 100644 (file)
@@ -36,6 +36,7 @@ defaultAvatar = avatar.AvatarCache().setAvatar(defaultAvatarData)
 
 def reloadConfig():
        msn.MSNConnection.GETALLAVATARS = config.getAllAvatars
 
 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 '%') """
 
 def isGroupJID(jid):
        """ Returns True if the JID passed is a valid groupchat JID (for MSN, does not contain '%') """
index edc622ab29b900cf56446584be1107438cd63f18..d06450f272f59846244c84d1b9dd38d66238dac7 100644 (file)
@@ -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 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
index 6b5376ff7396365788ccfc1ddf767c9b6f3e3b81..ac4cb55513e6985c02e74c8807bf065a3e277ccb 100644 (file)
@@ -154,7 +154,7 @@ STATUS_LUNCH   = 'LUN'
 
 PINGSPEED = 50.0
 
 
 PINGSPEED = 50.0
 
-DEBUGALL = True
+DEBUGALL = False
 LINEDEBUG = False
 MESSAGEDEBUG = False
 MSNP2PDEBUG = False
 LINEDEBUG = False
 MESSAGEDEBUG = False
 MSNP2PDEBUG = False