add ability to use own log function in debug mode