 ###
 class SailthruRequest
 
-    @user_agent = 'Sailthru API Node/JavaScript Client'
+    @logging: true # By default enable logging
+    @user_agent: 'Sailthru API Node/JavaScript Client'
 
     valid_methods = ['GET', 'POST', 'DELETE']
+
+    log2: (string) ->
+        log string if @logging is true
 
     _http_request: (uri, data, method, binary_data_params, callback) ->
         # support callback function as fourth arg

                # handle error
                return false

        log2 method + ' Request'

        req = http_protocol.request options, (res) ->
            body = ''
            res.setEncoding 'utf8'
            statusCode = res.statusCode
            log2 'Status Code: ' + res.statusCode
            res.on 'data', (chunk) ->
                body += chunk
            res.on 'end', ->


        (json_payload[param] = value for param, value of binary_data)

        @log2 _url.href + action
        @log2 'MultiPart Request'
        @log2 'JSON Payload: ' + JSON.stringify json_payload

        rest.post(_url.href + action, {
            multipart: true,
            'User-Agent': @request.user_agent,
            data: json_payload
        }).on 'complete', (data) ->
            callback null, data
