Only strip trailing whitespace from console logs

Logs may have whitespace prefixing used to properly left align content.
Preserve this and only strip trailing whitespace from the logs. Also to
simplify the process of stripping whitespace consolidate it all to just
before we write the logs rather than earlier in the process.

Change-Id: I6ca957902a9ea4a5f0dfdddeda4bd398a81979d9
2 files changed