 
       response.on "end", ->
         if response.statusCode >= 400
-          console.error "Slack services error: #{response.statusCode}"
-          console.error data
+          self.logError "Slack services error: #{response.statusCode}"
+          self.logError data
 
         #console.log "HTTPS response:", data
         if callback
           callback null, data
 
         response.on "error", (err) ->
-          console.error "HTTPS response error:", err
+          self.logError "HTTPS response error:", err
           if callback
             callback err, null
 

    self.robot.name = @options.name

    # Tell Hubot we're connected so it can load scripts
    console.log "Successfully 'connected' as", self.robot.name
    self.emit "connected"

  # Convenience HTTP Methods for sending data back to slack

    @request "POST", path, body, callback

  request: (method, path, body, callback) ->
    self = @

    #console.log method, path, body
    host = @options.team + '.slack.com'
    headers = "Host": host
