void handle_package(mp::Package &package);
void handle_search(mp::Package &package);
void handle_present(mp::Package &package);
- BackendPtr get_backend_from_databases(std::string &database,
+ BackendPtr get_backend_from_databases(const mp::Package &package,
+ std::string &database,
int *error,
char **addinfo,
ODR odr);
}
yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases(
+ const mp::Package &package,
std::string &database, int *error, char **addinfo, ODR odr)
{
std::list<BackendPtr>::const_iterator map_it;
FILE *file = fopen(fname, "w");
if (!file)
{
- yaz_log(YLOG_WARN|YLOG_ERRNO, "create %s", fname);
+ package.log("zoom", YLOG_WARN|YLOG_ERRNO, "create %s", fname);
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
*addinfo = (char *) odr_malloc(odr, 40 + strlen(fname));
sprintf(*addinfo, "Could not create %s", fname);
fwrite(wrbuf_buf(w), 1, wrbuf_len(w), file);
fclose(file);
- yaz_log(YLOG_LOG, "file %s created\n", fname);
+ package.log("zoom", YLOG_LOG, "file %s created\n", fname);
xfree(fname);
}
}
if (db_args.length())
url += "," + db_args;
- yaz_log(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)
{
int error = 0;
char *addinfo = 0;
std::string db(sr->databaseNames[0]);
- BackendPtr b = get_backend_from_databases(db, &error, &addinfo, odr);
+ BackendPtr b = get_backend_from_databases(package, db, &error,
+ &addinfo, odr);
if (error)
{
apdu_res =
assert(pqf_wrbuf == 0);
int cerror, cpos;
struct ccl_rpn_node *cn;
- yaz_log(YLOG_LOG, "CCL: %s", wrbuf_cstr(ccl_wrbuf));
+ package.log("zoom", YLOG_LOG, "CCL: %s", wrbuf_cstr(ccl_wrbuf));
cn = ccl_find_str(b->sptr->ccl_bibset, wrbuf_cstr(ccl_wrbuf),
&cerror, &cpos);
wrbuf_destroy(ccl_wrbuf);
}
pqf_wrbuf = wrbuf_alloc();
ccl_pquery(pqf_wrbuf, cn);
- yaz_log(YLOG_LOG, "RPN: %s", wrbuf_cstr(pqf_wrbuf));
+ package.log("zoom", YLOG_LOG, "RPN: %s", wrbuf_cstr(pqf_wrbuf));
ccl_rpn_delete(cn);
}
if (status == 0)
{
ZOOM_query_cql(q, wrbuf_cstr(wrb));
- yaz_log(YLOG_LOG, "CQL: %s", wrbuf_cstr(wrb));
+ package.log("zoom", YLOG_LOG, "CQL: %s", wrbuf_cstr(wrb));
b->search(q, &hits, &error, &addinfo, odr);
}
ZOOM_query_destroy(q);
else
{
ZOOM_query_prefix(q, wrbuf_cstr(pqf_wrbuf));
- yaz_log(YLOG_LOG, "search PQF: %s", wrbuf_cstr(pqf_wrbuf));
+ package.log("zoom", YLOG_LOG, "search PQF: %s", wrbuf_cstr(pqf_wrbuf));
b->search(q, &hits, &error, &addinfo, odr);
ZOOM_query_destroy(q);
wrbuf_destroy(pqf_wrbuf);