From: Adam Dickmeiss Date: Fri, 2 Dec 2011 17:57:10 +0000 (+0100) Subject: zoom: log CQL query and when parsing fails X-Git-Tag: v1.3.18~18 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5cf0d3a0f0bfbe8567d5e95830fe2d3794a58b27;p=metaproxy-moved-to-github.git zoom: log CQL query and when parsing fails --- diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 3fd7e04..e999281 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -114,7 +114,7 @@ namespace metaproxy_1 { void handle_package(mp::Package &package); void handle_search(mp::Package &package); void handle_present(mp::Package &package); - BackendPtr get_backend_from_databases(const mp::Package &package, + BackendPtr get_backend_from_databases(mp::Package &package, std::string &database, int *error, char **addinfo, @@ -644,7 +644,7 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only, } yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( - const mp::Package &package, + mp::Package &package, std::string &database, int *error, char **addinfo, ODR odr) { std::list::const_iterator map_it; @@ -956,7 +956,7 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( fwrite(wrbuf_buf(w), 1, wrbuf_len(w), file); fclose(file); - package.log("zoom", YLOG_LOG, "file %s created\n", fname); + package.log("zoom", YLOG_LOG, "file %s created", fname); xfree(fname); } @@ -982,7 +982,7 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( (char **) out_values); url += "," + std::string(x_args); } - package.log("zoom", YLOG_LOG, "url=%s", url.c_str()); + package.log("zoom", YLOG_LOG, "url: %s", url.c_str()); b->connect(url, error, addinfo, odr); if (*error == 0) { @@ -1365,9 +1365,11 @@ void yf::Zoom::Frontend::handle_search(mp::Package &package) const char *cql = query->u.type_104->u.cql; CQL_parser cp = cql_parser_create(); int r = cql_parser_string(cp, cql); + package.log("zoom", YLOG_LOG, "CQL: %s", cql); if (r) { cql_parser_destroy(cp); + package.log("zoom", YLOG_WARN, "CQL syntax error"); apdu_res = odr.create_searchResponse(apdu_req, YAZ_BIB1_MALFORMED_QUERY,