[Freeipa-devel] [PATCH] JSON client: Log pretty-printed request and response with -vv or above

Petr Viktorin pviktori at redhat.com
Tue Sep 23 14:15:31 UTC 2014


On 09/23/2014 03:13 PM, Petr Viktorin wrote:
> https://fedorahosted.org/freeipa/ticket/4233

After talking to Rob, I've changed what the -v means a bit more:

A single -v just turns on INFO logging, as before:

$ ipa -v ping
ipa: INFO: trying https://vm-073.idm.lab.eng.brq.redhat.com/ipa/json
ipa: INFO: Forwarding 'ping' to json server 
'https://vm-073.idm.lab.eng.brq.redhat.com/ipa/json'
-----------------------------------------------------
IPA server version 4.0.0GIT8543d4c. API version 2.102
-----------------------------------------------------

Two -v's pretty-print the request & response:

$ ipa -vv ping
ipa: INFO: trying https://vm-073.idm.lab.eng.brq.redhat.com/ipa/json
ipa: INFO: Forwarding 'ping' to json server 
'https://vm-073.idm.lab.eng.brq.redhat.com/ipa/json'
ipa: INFO: Request: {
     "id": 0,
     "method": "ping",
     "params": [
         [],
         {
             "version": "2.102"
         }
     ]
}
ipa: INFO: Response: {
     "error": null,
     "id": 0,
     "principal": "admin at IDM.LAB.ENG.BRQ.REDHAT.COM",
     "result": {
         "summary": "IPA server version 4.0.0GIT8543d4c. API version 2.102"
     },
     "version": "4.0.0GIT8543d4c"
}
-----------------------------------------------------
IPA server version 4.0.0GIT8543d4c. API version 2.102
-----------------------------------------------------

And three -v's print everything -- the pretty-printed JSON and all of 
the HTTP communication.

Also, when using XML-RPC, a single -v will now also print all the HTTP 
stuff. It could respond to two -v's as before I don't think it's worth 
complicating the code (keep in mind this is client only, XML-RPC is not 
used unless requested in the env).

This patch also updates the man page.

-- 
Petr³

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0648.2-JSON-client-Log-pretty-printed-request-and-response-.patch
Type: text/x-patch
Size: 3490 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140923/d0be97c8/attachment.bin>


More information about the Freeipa-devel mailing list