projects
/
mp-sparql-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
540b354
)
MPSPARQL-19: use package.log to return the queries for debugging
author
Heikki Levanto
<heikki@indexdata.dk>
Tue, 12 May 2015 12:02:54 +0000
(14:02 +0200)
committer
Heikki Levanto
<heikki@indexdata.dk>
Tue, 12 May 2015 12:02:54 +0000
(14:02 +0200)
src/filter_sparql.cpp
patch
|
blob
|
history
diff --git
a/src/filter_sparql.cpp
b/src/filter_sparql.cpp
index
cef45ef
..
638d2ba
100644
(file)
--- a/
src/filter_sparql.cpp
+++ b/
src/filter_sparql.cpp
@@
-448,6
+448,7
@@
Z_Records *yf::SPARQL::Session::fetch(
std::list<Result>::iterator it = fset->results.begin();
const char *schema = 0;
bool uri_lookup = false;
std::list<Result>::iterator it = fset->results.begin();
const char *schema = 0;
bool uri_lookup = false;
+ bool fetch_logged = false;
if (esn && esn->which == Z_ElementSetNames_generic)
schema = esn->u.generic;
if (esn && esn->which == Z_ElementSetNames_generic)
schema = esn->u.generic;
@@
-536,7
+537,19
@@
Z_Records *yf::SPARQL::Session::fetch(
uri.c_str(), schema);
if (!error)
{
uri.c_str(), schema);
if (!error)
{
- yaz_log(YLOG_LOG, "query=%s", query.c_str());
+ if (!fetch_logged)
+ { // Log the fetch query only once
+ package.log("sparql", YLOG_LOG,
+ "fetch query: for %s \n%s",
+ uri.c_str(), query.c_str() );
+ fetch_logged = true;
+ }
+ else
+ {
+ package.log("sparql", YLOG_LOG,
+ "fetch uri:%s", uri.c_str() );
+ }
+ //yaz_log(YLOG_LOG, "query=%s", query.c_str());
error = invoke_sparql(package, query.c_str(),
it->conf, w);
}
error = invoke_sparql(package, query.c_str(),
it->conf, w);
}
@@
-636,6
+649,9
@@
Z_APDU *yf::SPARQL::Session::search(mp::Package &package,
Z_APDU *apdu_res = 0;
mp::wrbuf w;
Z_APDU *apdu_res = 0;
mp::wrbuf w;
+ package.log("sparql", YLOG_LOG,
+ "search query:\n%s", sparql_query );
+
int error = invoke_sparql(package, sparql_query, conf, w);
if (error)
{
int error = invoke_sparql(package, sparql_query, conf, w);
if (error)
{