Bit more debug logging
authorHeikki Levanto <heikki@indexdata.dk>
Fri, 17 Jul 2015 13:49:25 +0000 (15:49 +0200)
committerHeikki Levanto <heikki@indexdata.dk>
Fri, 17 Jul 2015 13:49:25 +0000 (15:49 +0200)
src/client.c
src/session.c

index 644e42d..e1e8d6f 100644 (file)
@@ -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);
                             }
                         }
index e76da0a..b4ecc62 100644 (file)
@@ -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;