Added configuration option to turn on/off debug logging.