improve log.py