CrackMapExec icon indicating copy to clipboard operation
CrackMapExec copied to clipboard

Logging discrepancies ?

Open ShutdownRepo opened this issue 3 years ago • 1 comments

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?

ShutdownRepo avatar Feb 06 '22 14:02 ShutdownRepo

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.

Marshall-Hallenbeck avatar Apr 08 '23 18:04 Marshall-Hallenbeck