[Freeipa-devel] [PATCH][RFC] 13 - Log pretty-printed request and response

Petr Viktorin pviktori at redhat.com
Wed May 14 11:00:11 UTC 2014


On 04/23/2014 01:46 PM, Misnyovszki Adam wrote:
> On Wed, 16 Apr 2014 11:42:00 -0400
> Rob Crittenden <rcritten at redhat.com> wrote:
>
>> Misnyovszki Adam wrote:
>>> Hi,
>>> this patch enables logging json dumps of request and response, using
>>> the --log-payload switch in ipa cli. RFC tag is to ensure that I
>>> handled the --log-payload switch correctly in ipa cli. Be careful,
>>> it only logs, so --log-payload without -v switch doesn't make the
>>> dump visible in command line, -v does!
>>>
>>> https://fedorahosted.org/freeipa/ticket/4233
>>
>> Not a NACK but using -vvv makes this a much simpler operation as you
>> can then just compare verbose >= 3. This seems like a lot of work
>> just to pretty-print some output.
>>
>> rob
>>
>
> I've found out, that in RPCClient.create_connection, according to
> ipalib/backend.py:164, the variable verbose is not an int, rather a
> bool ( verbose=(self.env.verbose >= 2) ), so I decided not to break the
> workflow of this variable, but rather create a new one(log-payload).
>
> I was thinking, making verbose to an int would cause more work than to do
> it this way.

Maybe, but it would be better. We really want -vvv, it's much easier for 
the user to crank up the verbosity than to hunt for relevant logging 
options in the help.

If it's too much work, just use (api.env.verbose >= 3) directly.

-- 
Petr³




More information about the Freeipa-devel mailing list