removes unwanted whitespace in log message