Move logging into log.py.