Fix a bug in logger.