Logger cleanup
This merge request update all logger.warn calls to logger.warning as warn is obsolete.
It also removes all unused logger instances.
As drive-by contribution, it also did pre-commit cleanup as well as code improvements based on the output of bandit.