Refactor flake8 log creation for Jenkins