flush log on panic