Instantiate a logger in order to log.

Fixes #17762.
Remove deprecated and ignored PyLint options