Merge "Refactor and improve logging."
am: c3d41d5093

Change-Id: I8ef193a9ee0f5bf04ae18620c1a68228ed7ed929