chiark / gitweb /
crashing and msgs
[hippotat.git] / hippotat / __init__.py
index c1a6996bb862cb2a50cf08980ca3b35a5f679142..3e8649ae1e122f7b4252ad4dbc4453e54ffca673 100644 (file)
@@ -40,6 +40,7 @@ class DBG(twisted.python.constants.Names):
   QUEUE_CTRL = NamedConstant()
   HTTP_FULL = NamedConstant()
   SLIP_FULL = NamedConstant()
+  CTRL_DUMP = NamedConstant()
 
 _hex_codec = codecs.getencoder('hex_codec')
 
@@ -48,7 +49,7 @@ log = twisted.logger.Logger()
 def log_debug(dflag, msg, idof=None, d=None):
   #print('---------------->',repr((dflag, msg, idof, d)), file=sys.stderr)
   if idof is not None:
-    msg = '[%d] %s' % (id(idof), msg)
+    msg = '[%#x] %s' % (id(idof), msg)
   if d is not None:
     d = d[0:64]
     d = _hex_codec(d)[0].decode('ascii')
@@ -285,7 +286,8 @@ _crashing = False
 def crash(err):
   global _crashing
   _crashing = True
-  print('CRASH ', err, file=sys.stderr)
+  print('========== CRASH ==========', err,
+        '===========================', file=sys.stderr)
   try: reactor.stop()
   except twisted.internet.error.ReactorNotRunning: pass