better logging by removing \n\s*