Improved logging a bit + reformatting to make code more readable.
Authored by: peschau 2013-03-29
Parent: [r841]
Child: [r843]