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

RE: Want "deref=" in Statslog for searches



> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Hallvard B Furuseth

> 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. Dunno how much that matters.

> 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 );

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support