logging now uses c++ streams

This commit is contained in:
Jean-Francois Dockes
2016-07-12 09:41:04 +02:00
parent 7c4223088b
commit f6a999de84
123 changed files with 1974 additions and 2760 deletions
+8 -7
View File
@@ -19,7 +19,7 @@
#include "docseq.h"
#include "filtseq.h"
#include "sortseq.h"
#include "debuglog.h"
#include "log.h"
#include "internfile.h"
PTMutexInit DocSequence::o_dblock;
@@ -43,7 +43,7 @@ bool DocSequence::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
{
Rcl::Db *db = getDb();
if (db == 0) {
LOGERR(("DocSequence::getEnclosing: no db\n"));
LOGERR("DocSequence::getEnclosing: no db\n" );
return false;
}
PTMutexLocker locker(o_dblock);
@@ -67,7 +67,7 @@ void DocSource::stripStack()
bool DocSource::buildStack()
{
LOGDEB2(("DocSource::buildStack()\n"));
LOGDEB2("DocSource::buildStack()\n" );
stripStack();
if (!m_seq)
@@ -77,7 +77,7 @@ bool DocSource::buildStack()
// truncates the original list)
if (m_seq->canFilter()) {
if (!m_seq->setFiltSpec(m_fspec)) {
LOGERR(("DocSource::buildStack: setfiltspec failed\n"));
LOGERR("DocSource::buildStack: setfiltspec failed\n" );
}
} else {
if (m_fspec.isNotNull()) {
@@ -88,7 +88,7 @@ bool DocSource::buildStack()
if (m_seq->canSort()) {
if (!m_seq->setSortSpec(m_sspec)) {
LOGERR(("DocSource::buildStack: setsortspec failed\n"));
LOGERR("DocSource::buildStack: setsortspec failed\n" );
}
} else {
if (m_sspec.isNotNull()) {
@@ -114,7 +114,7 @@ string DocSource::title()
bool DocSource::setFiltSpec(const DocSeqFiltSpec &f)
{
LOGDEB2(("DocSource::setFiltSpec\n"));
LOGDEB2("DocSource::setFiltSpec\n" );
m_fspec = f;
buildStack();
return true;
@@ -122,9 +122,10 @@ bool DocSource::setFiltSpec(const DocSeqFiltSpec &f)
bool DocSource::setSortSpec(const DocSeqSortSpec &s)
{
LOGDEB2(("DocSource::setSortSpec\n"));
LOGDEB2("DocSource::setSortSpec\n" );
m_sspec = s;
buildStack();
return true;
}
+7 -9
View File
@@ -23,7 +23,7 @@
#include "docseqdb.h"
#include "rcldb.h"
#include "debuglog.h"
#include "log.h"
#include "wasatorcl.h"
using std::list;
@@ -77,7 +77,7 @@ static const string cstr_mre("[...]");
// We ignore most abstract/snippets preferences.
bool DocSequenceDb::getAbstract(Rcl::Doc &doc, vector<Rcl::Snippet>& vpabs)
{
LOGDEB(("DocSequenceDb::getAbstract/pair\n"));
LOGDEB("DocSequenceDb::getAbstract/pair\n" );
PTMutexLocker locker(o_dblock);
if (!setQuery())
return false;
@@ -89,8 +89,7 @@ bool DocSequenceDb::getAbstract(Rcl::Doc &doc, vector<Rcl::Snippet>& vpabs)
ret = m_q->makeDocAbstract(doc, vpabs, maxoccs,
m_q->whatDb()->getAbsCtxLen()+ 2);
}
LOGDEB(("DocSequenceDb::getAbstract: got ret %d vpabs len %u\n", ret,
vpabs.size()));
LOGDEB("DocSequenceDb::getAbstract: got ret " << (ret) << " vpabs len " << (vpabs.size()) << "\n" );
if (vpabs.empty()) {
return true;
}
@@ -161,7 +160,7 @@ string DocSequenceDb::title()
bool DocSequenceDb::setFiltSpec(const DocSeqFiltSpec &fs)
{
LOGDEB(("DocSequenceDb::setFiltSpec\n"));
LOGDEB("DocSequenceDb::setFiltSpec\n" );
PTMutexLocker locker(o_dblock);
if (fs.isNotNull()) {
// We build a search spec by adding a filtering layer to the base one.
@@ -209,8 +208,7 @@ bool DocSequenceDb::setFiltSpec(const DocSeqFiltSpec &fs)
bool DocSequenceDb::setSortSpec(const DocSeqSortSpec &spec)
{
LOGDEB(("DocSequenceDb::setSortSpec: fld [%s] %s\n",
spec.field.c_str(), spec.desc ? "desc" : "asc"));
LOGDEB("DocSequenceDb::setSortSpec: fld [" << (spec.field) << "] " << (spec.desc ? "desc" : "asc") << "\n" );
PTMutexLocker locker(o_dblock);
if (spec.isNotNull()) {
m_q->setSortBy(spec.field, !spec.desc);
@@ -233,8 +231,7 @@ bool DocSequenceDb::setQuery()
m_lastSQStatus = m_q->setQuery(m_fsdata);
if (!m_lastSQStatus) {
m_reason = m_q->getReason();
LOGERR(("DocSequenceDb::setQuery: rclquery::setQuery failed: %s\n",
m_reason.c_str()));
LOGERR("DocSequenceDb::setQuery: rclquery::setQuery failed: " << (m_reason) << "\n" );
}
return m_lastSQStatus;
}
@@ -248,3 +245,4 @@ bool DocSequenceDb::docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
return false;
}
}
+4 -4
View File
@@ -26,7 +26,7 @@ using std::list;
#include "rcldb.h"
#include "fileudi.h"
#include "base64.h"
#include "debuglog.h"
#include "log.h"
#include "smallut.h"
// Encode document history entry:
@@ -77,7 +77,7 @@ bool RclDHistoryEntry::decode(const string &value)
// Old style entry found, make an udi, using the fs udi maker
make_udi(fn, ipath, udi);
}
LOGDEB1(("RclDHistoryEntry::decode: udi [%s]\n", udi.c_str()));
LOGDEB1("RclDHistoryEntry::decode: udi [" << (udi) << "]\n" );
return true;
}
@@ -89,8 +89,7 @@ bool RclDHistoryEntry::equal(const DynConfEntry& other)
bool historyEnterDoc(RclDynConf *dncf, const string& udi)
{
LOGDEB1(("historyEnterDoc: [%s] into %s\n",
udi.c_str(), dncf->getFilename().c_str()));
LOGDEB1("historyEnterDoc: [" << (udi) << "] into " << (dncf->getFilename()) << "\n" );
RclDHistoryEntry ne(time(0), udi);
RclDHistoryEntry scratch;
return dncf->insertNew(docHistSubKey, ne, scratch, 200);
@@ -161,3 +160,4 @@ int DocSequenceHistory::getResCnt()
m_hlist = getDocHistory(m_hist);
return int(m_hlist.size());
}
+8 -6
View File
@@ -23,7 +23,7 @@
#include "dynconf.h"
#include "base64.h"
#include "smallut.h"
#include "debuglog.h"
#include "log.h"
using namespace std;
@@ -44,13 +44,13 @@ bool RclDynConf::insertNew(const string &sk, DynConfEntry &n, DynConfEntry &s,
for (it = names.begin(); it != names.end(); it++) {
string oval;
if (!m_data.get(*it, oval, sk)) {
LOGDEB(("No data for %s\n", (*it).c_str()));
LOGDEB("No data for " << ((*it)) << "\n" );
continue;
}
s.decode(oval);
if (s.equal(n)) {
LOGDEB(("Erasing old entry\n"));
LOGDEB("Erasing old entry\n" );
m_data.erase(*it, sk);
changed = true;
}
@@ -80,9 +80,9 @@ bool RclDynConf::insertNew(const string &sk, DynConfEntry &n, DynConfEntry &s,
string value;
n.encode(value);
LOGDEB1(("Encoded value [%s] (%d)\n", value.c_str(), value.size()));
LOGDEB1("Encoded value [" << (value) << "] (" << (value.size()) << ")\n" );
if (!m_data.set(string(nname), value, sk)) {
LOGERR(("RclDHistory::insertNew: set failed\n"));
LOGERR("RclDHistory::insertNew: set failed\n" );
return false;
}
return true;
@@ -124,7 +124,8 @@ list<string> RclDynConf::getStringList(const string sk)
#include <iostream>
#include "history.h"
#include "debuglog.h"
#include "log.h"
#ifndef NO_NAMESPACES
using namespace std;
@@ -211,3 +212,4 @@ int main(int argc, char **argv)
}
#endif
+8 -8
View File
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "debuglog.h"
#include "log.h"
#include "filtseq.h"
#include "rclconfig.h"
@@ -23,20 +23,19 @@ using std::string;
static bool filter(const DocSeqFiltSpec& fs, const Rcl::Doc *x)
{
LOGDEB2((" Filter: ncrits %d\n", fs.crits.size()));
LOGDEB2(" Filter: ncrits " << (fs.crits.size()) << "\n" );
// Compare using each criterion in term. We're doing an or:
// 1st ok ends
for (unsigned int i = 0; i < fs.crits.size(); i++) {
switch (fs.crits[i]) {
case DocSeqFiltSpec::DSFS_MIMETYPE:
LOGDEB2((" filter: MIMETYPE: me [%s] doc [%s]\n",
fs.values[i].c_str(), x->mimetype.c_str()));
LOGDEB2(" filter: MIMETYPE: me [" << (fs.values[i]) << "] doc [" << (x->mimetype) << "]\n" );
if (x->mimetype == fs.values[i])
return true;
break;
case DocSeqFiltSpec::DSFS_QLANG:
{
LOGDEB((" filter: QLANG [%s]!!\n", fs.values[i].c_str()));
LOGDEB(" filter: QLANG [" << (fs.values[i]) << "]!!\n" );
}
break;
case DocSeqFiltSpec::DSFS_PASSALL:
@@ -56,7 +55,7 @@ DocSeqFiltered::DocSeqFiltered(RclConfig *conf, STD_SHARED_PTR<DocSequence> iseq
bool DocSeqFiltered::setFiltSpec(const DocSeqFiltSpec &filtspec)
{
LOGDEB0(("DocSeqFiltered::setFiltSpec\n"));
LOGDEB0("DocSeqFiltered::setFiltSpec\n" );
for (unsigned int i = 0; i < filtspec.crits.size(); i++) {
switch (filtspec.crits[i]) {
case DocSeqFiltSpec::DSFS_MIMETYPE:
@@ -74,7 +73,7 @@ bool DocSeqFiltered::setFiltSpec(const DocSeqFiltSpec &filtspec)
m_config->getMimeCatTypes(catg, tps);
for (vector<string>::const_iterator it = tps.begin();
it != tps.end(); it++) {
LOGDEB2(("Adding mime: [%s]\n", it->c_str()));
LOGDEB2("Adding mime: [" << (it) << "]\n" );
m_spec.orCrit(DocSeqFiltSpec::DSFS_MIMETYPE, *it);
}
}
@@ -94,7 +93,7 @@ bool DocSeqFiltered::setFiltSpec(const DocSeqFiltSpec &filtspec)
bool DocSeqFiltered::getDoc(int idx, Rcl::Doc &doc, string *)
{
LOGDEB2(("DocSeqFiltered::getDoc() fetching %d\n", idx));
LOGDEB2("DocSeqFiltered::getDoc() fetching " << (idx) << "\n" );
if (idx >= (int)m_dbindices.size()) {
// Have to fetch docs and filter until we get enough or
@@ -122,3 +121,4 @@ bool DocSeqFiltered::getDoc(int idx, Rcl::Doc &doc, string *)
}
return true;
}
+22 -29
View File
@@ -31,7 +31,7 @@ using std::set;
#include "rcldb.h"
#include "rclconfig.h"
#include "debuglog.h"
#include "log.h"
#include "textsplit.h"
#include "utf8iter.h"
#include "smallut.h"
@@ -86,14 +86,12 @@ class TextSplitPTR : public TextSplit {
string dumb = term;
if (o_index_stripchars) {
if (!unacmaybefold(term, dumb, "UTF-8", UNACOP_UNACFOLD)) {
LOGINFO(("PlainToRich::takeword: unac failed for [%s]\n",
term.c_str()));
LOGINFO("PlainToRich::takeword: unac failed for [" << (term) << "]\n" );
return true;
}
}
//LOGDEB2(("Input dumbbed term: '%s' %d %d %d\n", dumb.c_str(),
// pos, bts, bte));
//LOGDEB2("Input dumbbed term: '" << (dumb) << "' " << (// pos) << " " << (bts) << " " << (bte) << "\n" );
// If this word is a search term, remember its byte-offset span.
map<string, size_t>::const_iterator it = m_terms.find(dumb);
@@ -106,7 +104,7 @@ class TextSplitPTR : public TextSplit {
// Term group (phrase/near) handling
m_plists[dumb].push_back(pos);
m_gpostobytes[pos] = pair<int,int>(bts, bte);
//LOGDEB2(("Recorded bpos for %d: %d %d\n", pos, bts, bte));
//LOGDEB2("Recorded bpos for " << (pos) << ": " << (bts) << " " << (bte) << "\n" );
}
// Check for cancellation request
@@ -169,8 +167,7 @@ static bool do_proximity_test(int window, vector<vector<int>* >& plists,
unsigned int i, int min, int max,
int *sp, int *ep, int minpos)
{
LOGDEB1(("do_prox_test: win %d i %d min %d max %d minpos %d\n",
window, i, min, max, minpos));
LOGDEB1("do_prox_test: win " << (window) << " i " << (i) << " min " << (min) << " max " << (max) << " minpos " << (minpos) << "\n" );
int tmp = max + 1 - window;
if (tmp < minpos)
tmp = minpos;
@@ -207,8 +204,7 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
const vector<string>& terms = m_hdata.groups[grpidx];
int window = int(m_hdata.groups[grpidx].size() + m_hdata.slacks[grpidx]);
LOGDEB1(("TextSplitPTR::matchGroup:d %d: %s\n", window,
vecStringToString(terms).c_str()));
LOGDEB1("TextSplitPTR::matchGroup:d " << (window) << ": " << (vecStringToString(terms)) << "\n" );
// The position lists we are going to work with. We extract them from the
// (string->plist) map
@@ -224,8 +220,7 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
it != terms.end(); it++) {
map<string, vector<int> >::iterator pl = m_plists.find(*it);
if (pl == m_plists.end()) {
LOGDEB1(("TextSplitPTR::matchGroup: [%s] not found in m_plists\n",
(*it).c_str()));
LOGDEB1("TextSplitPTR::matchGroup: [" << ((*it)) << "] not found in m_plists\n" );
return false;
}
plists.push_back(&(pl->second));
@@ -234,7 +229,7 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
// I think this can't actually happen, was useful when we used to
// prune the groups, but doesn't hurt.
if (plists.size() < 2) {
LOGDEB1(("TextSplitPTR::matchGroup: no actual groups found\n"));
LOGDEB1("TextSplitPTR::matchGroup: no actual groups found\n" );
return false;
}
// Sort the positions lists so that the shorter is first
@@ -245,11 +240,10 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
it = plistToTerm.find(plists[0]);
if (it == plistToTerm.end()) {
// SuperWeird
LOGERR(("matchGroup: term for first list not found !?!\n"));
LOGERR("matchGroup: term for first list not found !?!\n" );
return false;
}
LOGDEB1(("matchGroup: walking the shortest plist. Term [%s], len %d\n",
it->second.c_str(), plists[0]->size()));
LOGDEB1("matchGroup: walking the shortest plist. Term [" << (it->second) << "], len " << (plists[0]->size()) << "\n" );
}
// Minpos is the highest end of a found match. While looking for
@@ -262,10 +256,9 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
it != plists[0]->end(); it++) {
int pos = *it;
int sta = INT_MAX, sto = 0;
LOGDEB2(("MatchGroup: Testing at pos %d\n", pos));
LOGDEB2("MatchGroup: Testing at pos " << (pos) << "\n" );
if (do_proximity_test(window,plists, 1, pos, pos, &sta, &sto, minpos)) {
LOGDEB1(("TextSplitPTR::matchGroup: MATCH termpos [%d,%d]\n",
sta, sto));
LOGDEB1("TextSplitPTR::matchGroup: MATCH termpos [" << (sta) << "," << (sto) << "]\n" );
// Maybe extend the window by 1st term position, this was not
// done by do_prox..
SETMINMAX(pos, sta, sto);
@@ -274,15 +267,14 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
map<int, pair<int, int> >::iterator i1 = m_gpostobytes.find(sta);
map<int, pair<int, int> >::iterator i2 = m_gpostobytes.find(sto);
if (i1 != m_gpostobytes.end() && i2 != m_gpostobytes.end()) {
LOGDEB2(("TextSplitPTR::matchGroup: pushing bpos %d %d\n",
i1->second.first, i2->second.second));
LOGDEB2("TextSplitPTR::matchGroup: pushing bpos " << (i1->second.first) << " " << (i2->second.second) << "\n" );
tboffs.push_back(MatchEntry(i1->second.first,
i2->second.second, grpidx));
} else {
LOGDEB0(("matchGroup: no bpos found for %d or %d\n", sta, sto));
LOGDEB0("matchGroup: no bpos found for " << (sta) << " or " << (sto) << "\n" );
}
} else {
LOGDEB1(("matchGroup: no group match found at this position\n"));
LOGDEB1("matchGroup: no group match found at this position\n" );
}
}
@@ -333,7 +325,7 @@ bool PlainToRich::plaintorich(const string& in,
{
Chrono chron;
bool ret = true;
LOGDEB1(("plaintorichich: in: [%s]\n", in.c_str()));
LOGDEB1("plaintorichich: in: [" << (in) << "]\n" );
m_hdata = &hdata;
// Compute the positions for the query terms. We use the text
@@ -343,10 +335,10 @@ bool PlainToRich::plaintorich(const string& in,
// Note: the splitter returns the term locations in byte, not
// character, offsets.
splitter.text_to_words(in);
LOGDEB2(("plaintorich: split done %d mS\n", chron.millis()));
LOGDEB2("plaintorich: split done " << (chron.millis()) << " mS\n" );
// Compute the positions for NEAR and PHRASE groups.
splitter.matchGroups();
LOGDEB2(("plaintorich: group match done %d mS\n", chron.millis()));
LOGDEB2("plaintorich: group match done " << (chron.millis()) << " mS\n" );
out.clear();
out.push_back("");
@@ -359,7 +351,7 @@ bool PlainToRich::plaintorich(const string& in,
// a term match when we are actually looking for a group match
// (the snippet generator does this...).
if (splitter.tboffs.empty()) {
LOGDEB1(("plaintorich: no term matches\n"));
LOGDEB1("plaintorich: no term matches\n" );
ret = false;
}
@@ -372,7 +364,7 @@ bool PlainToRich::plaintorich(const string& in,
#if 0
for (vector<pair<int, int> >::const_iterator it = splitter.tboffs.begin();
it != splitter.tboffs.end(); it++) {
LOGDEB2(("plaintorich: region: %d %d\n", it->first, it->second));
LOGDEB2("plaintorich: region: " << (it->first) << " " << (it->second) << "\n" );
}
#endif
@@ -532,6 +524,7 @@ bool PlainToRich::plaintorich(const string& in,
fclose(fp);
}
#endif
LOGDEB2(("plaintorich: done %d mS\n", chron.millis()));
LOGDEB2("plaintorich: done " << (chron.millis()) << " mS\n" );
return ret;
}
+2 -1
View File
@@ -31,7 +31,7 @@
#include "rclconfig.h"
#include "pathut.h"
#include "rclinit.h"
#include "debuglog.h"
#include "log.h"
#include "wasatorcl.h"
#include "internfile.h"
#include "wipedir.h"
@@ -427,3 +427,4 @@ endopts:
return 0;
}
+10 -11
View File
@@ -31,7 +31,7 @@ using std::list;
#include "cstr.h"
#include "reslistpager.h"
#include "debuglog.h"
#include "log.h"
#include "rclconfig.h"
#include "smallut.h"
#include "rclutil.h"
@@ -67,13 +67,12 @@ ResListPager::ResListPager(int pagesize)
void ResListPager::resultPageNext()
{
if (!m_docSource) {
LOGDEB(("ResListPager::resultPageNext: null source\n"));
LOGDEB("ResListPager::resultPageNext: null source\n" );
return;
}
int resCnt = m_docSource->getResCnt();
LOGDEB(("ResListPager::resultPageNext: rescnt %d, winfirst %d\n",
resCnt, m_winfirst));
LOGDEB("ResListPager::resultPageNext: rescnt " << (resCnt) << ", winfirst " << (m_winfirst) << "\n" );
if (m_winfirst < 0) {
m_winfirst = 0;
@@ -125,13 +124,12 @@ static string maybeEscapeHtml(const string& fld)
void ResListPager::resultPageFor(int docnum)
{
if (!m_docSource) {
LOGDEB(("ResListPager::resultPageFor: null source\n"));
LOGDEB("ResListPager::resultPageFor: null source\n" );
return;
}
int resCnt = m_docSource->getResCnt();
LOGDEB(("ResListPager::resultPageFor(%d): rescnt %d, winfirst %d\n",
docnum, resCnt, m_winfirst));
LOGDEB("ResListPager::resultPageFor(" << (docnum) << "): rescnt " << (resCnt) << ", winfirst " << (m_winfirst) << "\n" );
m_winfirst = (docnum / m_pagesize) * m_pagesize;
// Get the next page of results.
@@ -324,7 +322,7 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
// the table approach for 1.15 for now (in guiutils.cpp)
// chunk << "<br style='clear:both;height:0;line-height:0;'>" << endl;
LOGDEB2(("Chunk: [%s]\n", (const char *)chunk.rdbuf()->str().c_str()));
LOGDEB2("Chunk: [" << ((const char *)chunk.rdbuf()->str()) << "]\n" );
append(chunk.rdbuf()->str(), i, doc);
}
@@ -340,13 +338,13 @@ bool ResListPager::getDoc(int num, Rcl::Doc& doc)
void ResListPager::displayPage(RclConfig *config)
{
LOGDEB(("ResListPager::displayPage\n"));
LOGDEB("ResListPager::displayPage\n" );
if (!m_docSource) {
LOGDEB(("ResListPager::displayPage: null source\n"));
LOGDEB("ResListPager::displayPage: null source\n" );
return;
}
if (m_winfirst < 0 && !pageEmpty()) {
LOGDEB(("ResListPager::displayPage: sequence error: winfirst < 0\n"));
LOGDEB("ResListPager::displayPage: sequence error: winfirst < 0\n" );
return;
}
@@ -526,3 +524,4 @@ const string &ResListPager::dateFormat()
return cstr_format;
}
+7 -6
View File
@@ -16,7 +16,7 @@
*/
#include <algorithm>
#include "debuglog.h"
#include "log.h"
#include "sortseq.h"
using std::string;
@@ -30,7 +30,7 @@ public:
// behaves as operator<
int operator()(const Rcl::Doc *x, const Rcl::Doc *y)
{
LOGDEB1(("Comparing .. \n"));
LOGDEB1("Comparing .. \n" );
map<string,string>::const_iterator xit, yit;
xit = x->meta.find(ss.field);
@@ -43,15 +43,15 @@ public:
bool DocSeqSorted::setSortSpec(const DocSeqSortSpec &sortspec)
{
LOGDEB(("DocSeqSorted::setSortSpec\n"));
LOGDEB("DocSeqSorted::setSortSpec\n" );
m_spec = sortspec;
int count = m_seq->getResCnt();
LOGDEB(("DocSeqSorted:: count %d\n", count));
LOGDEB("DocSeqSorted:: count " << (count) << "\n" );
m_docs.resize(count);
int i;
for (i = 0; i < count; i++) {
if (!m_seq->getDoc(i, m_docs[i])) {
LOGERR(("DocSeqSorted: getDoc failed for doc %d\n", i));
LOGERR("DocSeqSorted: getDoc failed for doc " << (i) << "\n" );
count = i;
break;
}
@@ -68,9 +68,10 @@ bool DocSeqSorted::setSortSpec(const DocSeqSortSpec &sortspec)
bool DocSeqSorted::getDoc(int num, Rcl::Doc &doc, string *)
{
LOGDEB(("DocSeqSorted::getDoc(%d)\n", num));
LOGDEB("DocSeqSorted::getDoc(" << (num) << ")\n" );
if (num < 0 || num >= int(m_docsp.size()))
return false;
doc = *m_docsp[num];
return true;
}
+4 -5
View File
@@ -21,7 +21,7 @@
#include "wasatorcl.h"
#include "wasaparserdriver.h"
#include "searchdata.h"
#include "debuglog.h"
#include "log.h"
#define YYDEBUG 1
@@ -177,14 +177,12 @@ bool WasaParserDriver::addClause(SearchData *sd,
if (!fld.compare("date")) {
DateInterval di;
if (!parsedateinterval(cl->gettext(), &di)) {
LOGERR(("Bad date interval format: %s\n",
cl->gettext().c_str()));
LOGERR("Bad date interval format: " << (cl->gettext()) << "\n" );
m_reason = "Bad date interval format";
delete cl;
return false;
}
LOGDEB(("addClause:: date span: %d-%d-%d/%d-%d-%d\n",
di.y1,di.m1,di.d1, di.y2,di.m2,di.d2));
LOGDEB("addClause:: date span: " << (di.y1) << "-" << (di.m1) << "-" << (di.d1) << "/" << (di.y2) << "-" << (di.m2) << "-" << (di.d2) << "\n" );
m_haveDates = true;
m_dates = di;
delete cl;
@@ -268,3 +266,4 @@ bool WasaParserDriver::addClause(SearchData *sd,
}
return sd->addClause(cl);
}