added debug logging and sphinx err/warning logging