Improve usage of Python logging module.