Tested and fixed logging for android