+ HTTP_FULL = NamedConstant()
+ SLIP_FULL = NamedConstant()
+
+_hex_codec = codecs.getencoder('hex_codec')
+
+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)
+ if d is not None:
+ #d = d[0:64]
+ d = _hex_codec(d)[0].decode('ascii')
+ msg += ' ' + d
+ log.info('{dflag} {msgcore}', dflag=dflag, msgcore=msg)