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.0.11~1 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=d2cbbfa12b18301e94bca427cf8bf1b2ea6151b3;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 92a0ecf..4239171 100644 --- a/src/logic.c +++ b/src/logic.c @@ -847,6 +847,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; @@ -1356,9 +1357,13 @@ struct record *ingest_record(struct client *cl, Z_External *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 72310aa..82498eb 100644 --- a/src/pazpar2.h +++ b/src/pazpar2.h @@ -138,6 +138,7 @@ struct session { int total_hits; int total_records; int total_merged; + int number_of_warnings_unknown_elements; }; struct statistics {