Setting up some logging functions
Added support upto API14, i.e 14, and tested till 17