CrackMapExec
CrackMapExec copied to clipboard
Logging discrepancies ?
Hey there, I was working on the source code of the ldap protocol (cme/protocols/ldap.py) and was wondering why some debug logging is made with self.logger.info and why other is made with logging.debug.
https://github.com/byt3bl33d3r/CrackMapExec/blob/6e57e4c3616b361fa44311389af2bbd7bb12839c/cme/protocols/ldap.py#L509
https://github.com/byt3bl33d3r/CrackMapExec/blob/6e57e4c3616b361fa44311389af2bbd7bb12839c/cme/protocols/ldap.py#L533
Is there a best practice to follow, which one should we use?
I am currently overhauling how CME does logging, since there's discrepancies like this, and some other stuff to help debugging and user output.
For as which level should be used where, you can read the Python documentation on that, which has some helpful examples: https://docs.python.org/3/howto/logging.html#when-to-use-logging
@mpgn You can probably tag this with "question" and mark it as resolved and answered.