format log, fix macro bug