From 3e35fc99a2863b179d76897c8bb748cad183b816 Mon Sep 17 00:00:00 2001 Message-Id: <3e35fc99a2863b179d76897c8bb748cad183b816.1716212224.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 2 Apr 2017 02:01:33 +0100 Subject: [PATCH] init debug Organization: Straylight/Edgeware From: Ian Jackson --- hippotat/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- [mdw]