Added log functions and debug variable for the instance