From 69ecd6f0b231bd7542f242d8d1e13edc4bed0632 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 17 Jul 2015 15:49:25 +0200 Subject: [PATCH] Bit more debug logging --- src/client.c | 8 +++++++- src/session.c | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 644e42d..e1e8d6f 100644 --- a/src/client.c +++ b/src/client.c @@ -1383,8 +1383,12 @@ static int apply_limit(struct client *cl, const char *id = session_lookup_id_facet(cl->session, cl, name, values[i]); - if (id) + if (id) { values[i] = nmem_strdup(nmem_tmp, id); + yaz_log(YLOG_DEBUG, + "apply_limit: s='%s' found id '%s'",s->name,id ); + + } } nmem_strsplit_escape2(nmem_tmp, ",", s->value, &cvalues, &cnum, 1, '\\', 1); @@ -1433,6 +1437,8 @@ static int apply_limit(struct client *cl, if (i < num - 1) wrbuf_printf(w_pqf, "@or "); ccl_pquery(w_pqf, cn); + yaz_log(YLOG_DEBUG,"apply_limit (ccl): %s", + wrbuf_cstr(w_pqf)); ccl_rpn_delete(cn); } } diff --git a/src/session.c b/src/session.c index e76da0a..b4ecc62 100644 --- a/src/session.c +++ b/src/session.c @@ -233,12 +233,14 @@ const char *session_lookup_id_facet(struct session *s, struct client *cl, const char *term) { struct facet_id *t = s->facet_id_list; - for (; t; t = t->next) + for (; t; t = t->next) + { if (!strcmp(client_get_id(cl), t->client_id) && !strcmp(t->type, type) && !strcmp(t->term, term)) { return t->id; } + } return 0; } @@ -261,8 +263,9 @@ void add_facet(struct session *s, const char *type, const char *value, int count } type += 6; } - session_normalize_facet(s, type, value, display_wrbuf, facet_wrbuf); + yaz_log(YLOG_DEBUG,"add_facet t='%s' v='%s' id='%s' d='%s' f='%s'", + type, value, id, wrbuf_cstr(display_wrbuf), wrbuf_cstr(facet_wrbuf) ); if (wrbuf_len(facet_wrbuf)) { struct named_termlist **tp = &s->termlists; -- 1.7.10.4