Factor out flake8 output to log function.