From: Adam Dickmeiss Date: Thu, 23 Oct 2008 07:46:42 +0000 (+0200) Subject: Only report 'unknown metadata element' once per session. X-Git-Tag: v1.1.0~81^2~2 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=018e5efbcf436e0211bce6594a81c1501e29d1a9;p=pazpar2-moved-to-github.git Only report 'unknown metadata element' once per session. --- diff --git a/src/logic.c b/src/logic.c index 2096f30..266aa0a 100644 --- a/src/logic.c +++ b/src/logic.c @@ -697,6 +697,7 @@ struct session *new_session(NMEM nmem) session->total_hits = 0; session->total_records = 0; session->number_of_warnings_unknown_elements = 0; + session->number_of_warnings_unknown_metadata = 0; session->num_termlists = 0; session->reclist = 0; session->clients = 0; @@ -1019,7 +1020,7 @@ struct record *ingest_record(struct client *cl, const char *rec, return 0; } relevance_newrec(se->relevance, cluster); - + // now parsing XML record and adding data to cluster or record metadata for (n = root->children; n; n = n->next) @@ -1051,8 +1052,12 @@ struct record *ingest_record(struct client *cl, const char *rec, = conf_service_metadata_field_id(service, (const char *) type); if (md_field_id < 0) { - yaz_log(YLOG_WARN, - "Ignoring unknown metadata element: %s", type); + if (se->number_of_warnings_unknown_metadata == 0) + { + yaz_log(YLOG_WARN, + "Ignoring unknown metadata element: %s", type); + } + se->number_of_warnings_unknown_metadata++; continue; } diff --git a/src/pazpar2.h b/src/pazpar2.h index ded428d..8a09240 100644 --- a/src/pazpar2.h +++ b/src/pazpar2.h @@ -140,6 +140,7 @@ struct session { int total_records; int total_merged; int number_of_warnings_unknown_elements; + int number_of_warnings_unknown_metadata; }; struct statistics {