jborean93 / pypsrp

PowerShell Remoting Protocol for Python
MIT License
324 stars 49 forks source link

The log level can be optimized. #100

Closed CriProphet closed 3 years ago

CriProphet commented 3 years ago

The current log level is the default log level. Each module uses the logging module to generate logs. The default log level of the logging module is DEBUG. This setting causes a large number of unnecessary logs to be generated during program execution, occupying too much disk space. Can I write a log module? This command is used in pypsrp and request-credssp and sets the default log level to INFO. When debugging is required, you can switch the log level to DEBUG or a lower level. When debugging is not required, you can switch the log level to INFO or a higher level. log = logging.getLogger(__name__) log.setLevel(logging.INFO)

jborean93 commented 3 years ago

The log level is entirely up to the caller, pypsrp doesn't set anything and it shouldn't be the decider in this. If you are talking about how Ansible sets the log to DEBUG then that's a problem on their side and not something that can be solved here.