From: Neil Cook Date: Thu, 24 Aug 2017 12:47:45 +0000 (+0100) Subject: Add requestorId and deviceId to summary log X-Git-Tag: rec-4.1.0-rc1~54^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1127b0824724cb4ad9af4bc4b1d8023e990b0ba3;p=thirdparty%2Fpdns.git Add requestorId and deviceId to summary log --- diff --git a/contrib/ProtobufLogger.py b/contrib/ProtobufLogger.py index 5075e43f7d..64a40248e2 100644 --- a/contrib/ProtobufLogger.py +++ b/contrib/ProtobufLogger.py @@ -144,16 +144,20 @@ class PDNSPBConnHandler(object): if requestor: requestorstr = ' (' + requestor + ')' - print('[%s] %s of size %d: %s%s -> %s (%s), id: %d, uuid: %s%s' % (datestr, - typestr, - msg.inBytes, - ipfromstr, - requestorstr, - iptostr, - protostr, - msg.id, - messageidstr, - initialrequestidstr)) + deviceId = binascii.hexlify(bytearray(msg.deviceId)) + requestorId = msg.requestorId + + print('[%s] %s of size %d: %s%s -> %s (%s), id: %d, uuid: %s%s ' + 'requestorid: %s deviceid: %s' % (datestr, + typestr, + msg.inBytes, + ipfromstr, + requestorstr, + iptostr, + protostr, + msg.id, + messageidstr, + initialrequestidstr)) def getRequestorSubnet(self, msg): requestorstr = None