[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Want "deref=" in Statslog for searches



Howard Chu writes:
>> May I add "deref=%d" to the Statslog() output for search operations in
>> slapd/search.c?  The format would be
>>
>>   conn=%lu op=%lu SRCH base="%s" scope=%d deref=%d filter="%s"
> 
> I'm sure we never promised a particular format for log messages, but I know
> there's folks out there parsing these things.

We should not do it in OpenLDAP 2.1, then.  I suggest we do it in 2.2
and note in the release notes that the Statslog format of search entries
has changed.

>> I'd need to add yet another argument to the Statslog() macro.
>> Or maybe I should split it in two macros: Statslog3() with 3 arguments
>> and Statslog6() with 6 arguments?  Most calls only need 2-3 arguments.
> 
> That may be the right way to go. In this particular case, I'd suggest just
> throwing the additional text into abuf:
> 
> sprintf(abuf, "scope=%d, deref=%d", op->ors_scope, op->ors_deref);
> Statslog( LDAP_DEBUG_STATS,
> 	"conn=%lu op=%lu SRCH base=\"%s\" %s filter=\"%s\"\n",
> 	op->o_connid, op->o_opid, op->o_req_dn.bv_val, abuf,
> 	op->ors_filterstr.bv_val );

Good idea.

-- 
Hallvard