mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-19 09:45:48 -04:00
Add the logsize option
Add -S or --logsize to define a maximum size for the logs.
This commit is contained in:
parent
83a59b3584
commit
96ac35104f
12 changed files with 165 additions and 119 deletions
|
@ -10,6 +10,8 @@ from kmsBase import kmsBase
|
|||
from structure import Structure
|
||||
from formatText import justify, shell_message
|
||||
|
||||
logger = logging.getLogger('root')
|
||||
|
||||
class kmsRequestV5(kmsBase):
|
||||
class RequestV5(Structure):
|
||||
class Message(Structure):
|
||||
|
@ -135,8 +137,8 @@ class kmsRequestV5(kmsBase):
|
|||
response['padding'] = bytearray(self.getPadding(bodyLength))
|
||||
|
||||
shell_message(nshell = 16)
|
||||
logging.info("KMS V%d Response: \n%s\n" % (self.ver, justify(response.dump(print_to_stdout = False))))
|
||||
logging.info("KMS V%d Structure Bytes: \n%s\n" % (self.ver, justify(binascii.b2a_hex(str(response)))))
|
||||
logger.info("KMS V%d Response: \n%s\n" % (self.ver, justify(response.dump(print_to_stdout = False))))
|
||||
logger.info("KMS V%d Structure Bytes: \n%s\n" % (self.ver, justify(binascii.b2a_hex(str(response)))))
|
||||
|
||||
return str(response)
|
||||
|
||||
|
@ -166,7 +168,7 @@ class kmsRequestV5(kmsBase):
|
|||
request['message'] = message
|
||||
|
||||
shell_message(nshell = 10)
|
||||
logging.info("Request V%d Data: \n%s\n" % (self.ver, justify(request.dump(print_to_stdout = False))))
|
||||
logging.info("Request V%d: \n%s\n" % (self.ver, justify(binascii.b2a_hex(str(request)))))
|
||||
logger.info("Request V%d Data: \n%s\n" % (self.ver, justify(request.dump(print_to_stdout = False))))
|
||||
logger.info("Request V%d: \n%s\n" % (self.ver, justify(binascii.b2a_hex(str(request)))))
|
||||
|
||||
return request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue