PEP8 fixes and return log after it is created.