From: Ian Jackson Date: Sun, 2 Apr 2017 01:01:33 +0000 (+0100) Subject: init debug X-Git-Tag: hippotat/1.0.0~55^2~139 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=commitdiff_plain;h=3e35fc99a2863b179d76897c8bb748cad183b816 init debug --- diff --git a/hippotat/__init__.py b/hippotat/__init__.py index e13b31f..b6a84d9 100644 --- a/hippotat/__init__.py +++ b/hippotat/__init__.py @@ -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)