Strip all trailing whitespace and only log out non empty command results.