minor improvements on flush for logger