Strip whitespace around log messages for display