trim excess whitespace in log messages