switch debug to log