chiark / gitweb /
init debug
[hippotat.git] / hippotat / __init__.py
index e13b31f642429f443da389eb7095e350155d0baa..b6a84d9546903868edf9d6830f4b8df2de92b08c 100644 (file)
@@ -49,8 +49,10 @@ _hex_codec = codecs.getencoder('hex_codec')
 
 log = twisted.logger.Logger()
 
+debug_set = set([x for x in DBG.iterconstants() if x <= DBG.HTTP])
+
 def log_debug(dflag, msg, idof=None, d=None):
-  if dflag > DBG.HTTP: return
+  if dflag not in debug_set: return
   #print('---------------->',repr((dflag, msg, idof, d)), file=sys.stderr)
   if idof is not None:
     msg = '[%#x] %s' % (id(idof), msg)