pyHPSU
pyHPSU copied to clipboard
log improvement
Hallo. My suggestion is to improve the logging. Current problems are:
- Output log level cannot be controller via options, it is hardcoded
- "printd()" method mixes log, output message and has also dependency on it parent implementation, because of the "
self.driver != "HPSUD"
" check - Developers are discouraged to add log because of how "printd()" is implemented, the risk of writing to stdout along command output is real; current code has no log at DEBUG or INFO level probably because of this
- Log is substantially absent
- Implemented log levels are not the usual ones, e.g. DEBUG level is missing
- Logging methods specify level using strings and this is prone to error and inhibits code auto-completion
I prepared a pull request solving all of this, it is really "big" because it removes printd() in favor of standard logging methods and this involves almost all of the python files. I will submit the pull request so we can discuss on the technical decisions, if you are interested on.