sassoftware / python-swat

The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the Python client to SAS Cloud Analytic Services (CAS). It allows users to execute CAS actions and process the results all from Python.
Other
147 stars 63 forks source link

Hide requests details when using protocol http #139

Closed gygabyte017 closed 2 years ago

gygabyte017 commented 2 years ago

Hi, using the http protocol I noticed that every request is logged in the console as:

POST http://xxx/cas/sessions/ddc18ffd-db7a-3540-b31a-fd3fae15b56c/actions/builtins.help
User-Agent: python-requests/2.28.1
Accept-Encoding: gzip, deflate, br
Accept: application/json
Connection: keep-alive
Content-Type: application/json
Content-Length: 63
Authorization: b'Basic xxx

Is there a way to disable this output when not needed? Thank you

bkemper24 commented 2 years ago

You should only see those messages when you have request debugging turned on. What value do you get back when you run:

swat.get_option('cas.debug.requests') swat.get_option('cas.debug.request_bodies')

What release of the python-swat client are you running ?

gygabyte017 commented 2 years ago

Thank you, I found indeed that somewhere in the code these options were activated:

        swat.options.cas.debug.requests = True
        swat.options.cas.debug.request_bodies = True
        swat.options.cas.debug.responses = True

Removing these lines works as expected.