From: Adam Dickmeiss Date: Wed, 15 Oct 2008 10:05:39 +0000 (+0200) Subject: Only warn about unexpected elements once per session. X-Git-Tag: v1.1.0~94 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=98748934f357929917e4884ea656b1a003d4c775;p=pazpar2-moved-to-github.git Only warn about unexpected elements once per session. --- diff --git a/src/logic.c b/src/logic.c index 4ac92f0..167c2ae 100644 --- a/src/logic.c +++ b/src/logic.c @@ -707,6 +707,7 @@ struct session *new_session(NMEM nmem) session->relevance = 0; session->total_hits = 0; session->total_records = 0; + session->number_of_warnings_unknown_elements = 0; session->num_termlists = 0; session->reclist = 0; session->requestid = -1; @@ -1214,9 +1215,13 @@ struct record *ingest_record(struct client *cl, const char *rec, xmlFree(value); type = value = 0; } - else - yaz_log(YLOG_WARN, - "Unexpected element %s in internal record", n->name); + else + { + if (se->number_of_warnings_unknown_elements == 0) + yaz_log(YLOG_WARN, + "Unexpected element in internal record: %s", n->name); + se->number_of_warnings_unknown_elements++; + } } if (type) xmlFree(type); diff --git a/src/pazpar2.h b/src/pazpar2.h index 728bc3d..4330881 100644 --- a/src/pazpar2.h +++ b/src/pazpar2.h @@ -140,6 +140,7 @@ struct session { int total_hits; int total_records; int total_merged; + int number_of_warnings_unknown_elements; }; struct statistics {