mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-18 17:25:23 -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, byterize
|
||||
|
||||
logger = logging.getLogger('root')
|
||||
|
||||
class kmsRequestV5(kmsBase):
|
||||
class RequestV5(Structure):
|
||||
class Message(Structure):
|
||||
|
@ -138,8 +140,8 @@ class kmsRequestV5(kmsBase):
|
|||
|
||||
shell_message(nshell = 16)
|
||||
response = byterize(response)
|
||||
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).encode('latin-1')).decode('utf-8'))))
|
||||
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).encode('latin-1')).decode('utf-8'))))
|
||||
|
||||
return str(response)
|
||||
|
||||
|
@ -170,7 +172,7 @@ class kmsRequestV5(kmsBase):
|
|||
|
||||
shell_message(nshell = 10)
|
||||
request = byterize(request)
|
||||
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).encode('latin-1')).decode('utf-8'))))
|
||||
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).encode('latin-1')).decode('utf-8'))))
|
||||
|
||||
return request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue