chiark / gitweb /
wip debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Apr 2017 00:56:57 +0000 (01:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Apr 2017 00:56:57 +0000 (01:56 +0100)
client
hippotat/__init__.py

diff --git a/client b/client
index a5edd7eef802e37c00dc35e9a7d790bfc63b0b11..19efb03e7eb5f7d4fa367b9861af8442554acb9c 100755 (executable)
--- a/client
+++ b/client
@@ -81,7 +81,7 @@ class ResponseConsumer(GeneralResponseConsumer):
     self._log(DBG.HTTP_CTRL, '__init__')
 
   def dataReceived(self, data):
-    self._log(DBG.HTTP_CTRL, 'dataReceived', d=data)
+    self._log(DBG.HTTP, 'dataReceived', d=data)
     try:
       self._ssd.inputdata(data)
     except Exception as e:
@@ -93,6 +93,7 @@ class ResponseConsumer(GeneralResponseConsumer):
       self.latefailure()
       return
     try:
+      self._log(DBG.HTTP, 'ResponseDone')
       self._ssd.flush()
       req_fin(self._req)
     except Exception as e:
@@ -102,7 +103,7 @@ class ResponseConsumer(GeneralResponseConsumer):
     self._latefailure(traceback.format_exc())
 
   def _latefailure(self, reason):
-    self._log(DBG.HTTP_CTRL, '_asyncFailure ' + str(reason))
+    self._log(DBG.HTTP_CTRL, '_latefailure ' + str(reason))
     req_err(self._req, reason)
 
 class ErrorResponseConsumer(twisted.internet.protocol.Protocol):
index fa43065759d82332d9f61c5b4d8305c5346bf32c..e13b31f642429f443da389eb7095e350155d0baa 100644 (file)
@@ -32,23 +32,25 @@ import re as regexp
 import hippotat.slip as slip
 
 class DBG(twisted.python.constants.Names):
+  INIT = NamedConstant()
   ROUTE = NamedConstant()
   DROP = NamedConstant()
   FLOW = NamedConstant()
   HTTP = NamedConstant()
-  HTTP_CTRL = NamedConstant()
-  INIT = NamedConstant()
+  TWISTED = NamedConstant()
   QUEUE = NamedConstant()
+  HTTP_CTRL = NamedConstant()
   QUEUE_CTRL = NamedConstant()
   HTTP_FULL = NamedConstant()
-  SLIP_FULL = NamedConstant()
   CTRL_DUMP = NamedConstant()
+  SLIP_FULL = NamedConstant()
 
 _hex_codec = codecs.getencoder('hex_codec')
 
 log = twisted.logger.Logger()
 
 def log_debug(dflag, msg, idof=None, d=None):
+  if dflag > DBG.HTTP: return
   #print('---------------->',repr((dflag, msg, idof, d)), file=sys.stderr)
   if idof is not None:
     msg = '[%#x] %s' % (id(idof), msg)