fix trap log output nl safe