use log.error, fix style