#include <metaproxy/util.hpp>
#include <metaproxy/xmlutil.hpp>
+#include <yaz/oid_db.h>
#include <yaz/zgdu.h>
#include <yaz/wrbuf.h>
#include <yaz/log.h>
static void log_DefaultDiagFormat(WRBUF w, Z_DefaultDiagFormat *e)
{
if (e->condition)
- wrbuf_printf(w, ODR_INT_PRINTF " ",*e->condition);
+ wrbuf_printf(w, ODR_INT_PRINTF " ", *e->condition);
else
wrbuf_puts(w, "?? ");
if (e->which == Z_DefaultDiagFormat_v2Addinfo && e->u.v2Addinfo)
+ {
+ wrbuf_puts(w, "\"");
wrbuf_puts(w, e->u.v2Addinfo);
+ wrbuf_puts(w, "\"");
+ }
else if (e->which == Z_DefaultDiagFormat_v3Addinfo && e->u.v3Addinfo)
+ {
+ wrbuf_puts(w, "\"");
wrbuf_puts(w, e->u.v3Addinfo);
+ wrbuf_puts(w, "\"");
+ }
+ else
+ wrbuf_puts(w, "-");
}
static void log_DiagRecs(WRBUF w, int num_diagRecs, Z_DiagRec **diags)
}
}
+static void log_syntax(WRBUF w, const Odr_oid *syntax)
+{
+ if (syntax)
+ {
+ char oid_name[OID_STR_MAX+1];
+ wrbuf_puts(w, yaz_oid_to_string_buf(syntax, 0, oid_name));
+ }
+ else
+ wrbuf_puts(w, "-");
+}
+
static void log_1_line(Z_APDU *z_req, Z_APDU *z_res, WRBUF w)
{
switch (z_req->which)
res->records->u.multipleNonSurDiagnostics->num_diagRecs,
res->records->u.multipleNonSurDiagnostics->diagRecs);
}
+ wrbuf_puts(w, " ");
+ log_syntax(w, req->preferredRecordSyntax);
wrbuf_printf(w, " 1+" ODR_INT_PRINTF " ",
res->numberOfRecordsReturned
? *res->numberOfRecordsReturned : 0);
res->records->u.multipleNonSurDiagnostics->num_diagRecs,
res->records->u.multipleNonSurDiagnostics->diagRecs);
}
+ wrbuf_puts(w, " ");
+ assert(req->preferredRecordSyntax);
+ log_syntax(w, req->preferredRecordSyntax);
+
wrbuf_printf(w, " %s " ODR_INT_PRINTF "+" ODR_INT_PRINTF " ",
req->resultSetId, *req->resultSetStartPoint,
*req->numberOfRecordsRequested);