Updated LogMessageFunction to log output to LogCat