SF.net SVN: fclient: [587] trunk/fclient/src/fclient/lib/fcp2/iohandler.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-12 11:09:29
|
Revision: 587
http://fclient.svn.sourceforge.net/fclient/?rev=587&view=rev
Author: jUrner
Date: 2008-07-12 04:09:38 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
comb over logging
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/iohandler.py
Modified: trunk/fclient/src/fclient/lib/fcp2/iohandler.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-12 11:08:48 UTC (rev 586)
+++ trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-12 11:09:38 UTC (rev 587)
@@ -99,6 +99,7 @@
@param host: (str) host to connect to
@param port: (int) port to use
"""
+ consts.ConstLogger.IO.debug(consts.ConstLogMessages.Connecting + ' {%r' % {'host': host, 'port': port})
if self.isOpen():
self.close()
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -132,6 +133,7 @@
raise consts.ErrorIOBroken(details, consts.ConstLogger.IO.error)
def close(self):
+ consts.ConstLogger.IO.debug(consts.ConstLogMessages.Closing)
if self.socket is None:
raise consts.ErrorIOClosed('Closed', consts.ConstLogger.IO.error)
self.socket.close()
@@ -199,7 +201,6 @@
try:
self.io.connect(**kwargs)
except consts.ErrorIOConnectFailed, details:
- consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.ConnectingFailed + ' (%s)' % details)
yield False
else:
consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.Connected)
@@ -207,7 +208,7 @@
break
# continue polling
- consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.Retry)
+ consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.RetryingConnect)
timeElapsed += timeout
time.sleep(timeout)
@@ -322,7 +323,7 @@
self._receiveBuffer = chunk + self._receiveBuffer
raise ErrorIOTimeout(details)
- consts.ConstLogger.IOHandler.debug(consts.ConstLogMessages.Received + msg.pprint())
+ consts.ConstLogger.IOHandler.log(consts.ConstDebugVerbosity.Message, consts.ConstLogMessages.Received + msg.pprint())
return msg
@@ -332,7 +333,7 @@
@return: Message
@raise L{consts.ErrorIOBroken}: if the connection to the io dies unexpectedly
"""
- consts.ConstLogger.IOHandler.debug(consts.ConstLogMessages.Sending + msg.pprint())
+ consts.ConstLogger.IOHandler.log(consts.ConstDebugVerbosity.Message, consts.ConstLogMessages.Sending + msg.pprint())
self.io.write(msg.toString())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|