Log of any base and some more error checking