This patch adds a user configurable debug level. For testing it includes connection info and reporting errors.