Move logging into separate module

Change-Id: I4cfdfb63438821d977a6776593f6e7e59ef08506