fixed a few forgotten log statements

This commit is contained in:
Jean-Francois Dockes 2016-07-13 07:47:56 +02:00
parent 5af2d79604
commit 8f77b987ca
4 changed files with 38 additions and 44 deletions

View File

@ -135,7 +135,7 @@ static HANDLE eWorkFinished = INVALID_HANDLE_VALUE;
static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
{ {
LOGDEB(("CtrlHandler\n")); LOGDEB("CtrlHandler\n" );
if (l_sigcleanup == 0) if (l_sigcleanup == 0)
return FALSE; return FALSE;
@ -147,12 +147,12 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
case CTRL_SHUTDOWN_EVENT: case CTRL_SHUTDOWN_EVENT:
{ {
l_sigcleanup(SIGINT); l_sigcleanup(SIGINT);
LOGDEB0(("CtrlHandler: waiting for exit ready\n")); LOGDEB0("CtrlHandler: waiting for exit ready\n" );
DWORD res = WaitForSingleObject(eWorkFinished, INFINITE); DWORD res = WaitForSingleObject(eWorkFinished, INFINITE);
if (res != WAIT_OBJECT_0) { if (res != WAIT_OBJECT_0) {
LOGERR(("CtrlHandler: exit ack wait failed\n")); LOGERR("CtrlHandler: exit ack wait failed\n" );
} }
LOGDEB0(("CtrlHandler: got exit ready event, exiting\n")); LOGDEB0("CtrlHandler: got exit ready event, exiting\n" );
return TRUE; return TRUE;
} }
default: default:
@ -170,12 +170,12 @@ LRESULT CALLBACK MainWndProc(HWND hwnd , UINT msg , WPARAM wParam,
case WM_CLOSE: case WM_CLOSE:
{ {
l_sigcleanup(SIGINT); l_sigcleanup(SIGINT);
LOGDEB(("MainWndProc: got end message, waiting for work finished\n")); LOGDEB("MainWndProc: got end message, waiting for work finished\n" );
DWORD res = WaitForSingleObject(eWorkFinished, INFINITE); DWORD res = WaitForSingleObject(eWorkFinished, INFINITE);
if (res != WAIT_OBJECT_0) { if (res != WAIT_OBJECT_0) {
LOGERR(("MainWndProc: exit ack wait failed\n")); LOGERR("MainWndProc: exit ack wait failed\n" );
} }
LOGDEB(("MainWindowProc: got exit ready event, exiting\n")); LOGDEB("MainWindowProc: got exit ready event, exiting\n" );
return TRUE; return TRUE;
} }
default: default:
@ -235,14 +235,14 @@ void initAsyncSigs(void (*sigcleanup)(int))
SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
eWorkFinished = CreateEvent(NULL, TRUE, FALSE, NULL); eWorkFinished = CreateEvent(NULL, TRUE, FALSE, NULL);
if (eWorkFinished == INVALID_HANDLE_VALUE) { if (eWorkFinished == INVALID_HANDLE_VALUE) {
LOGERR(("initAsyncSigs: error creating exitready event\n")); LOGERR("initAsyncSigs: error creating exitready event\n" );
} }
} }
void recoll_exitready() void recoll_exitready()
{ {
LOGDEB(("recoll_exitready()\n")); LOGDEB("recoll_exitready()\n" );
if (!SetEvent(eWorkFinished)) { if (!SetEvent(eWorkFinished)) {
LOGERR(("recoll_exitready: SetEvent failed\n")); LOGERR("recoll_exitready: SetEvent failed\n" );
} }
} }
@ -340,18 +340,17 @@ RclConfig *recollinit(RclInitFlags flags,
bool novfork; bool novfork;
config->getConfParam("novfork", &novfork); config->getConfParam("novfork", &novfork);
if (novfork) { if (novfork) {
LOGDEB0(("rclinit: will use fork() for starting commands\n")); LOGDEB0("rclinit: will use fork() for starting commands\n" );
ExecCmd::useVfork(false); ExecCmd::useVfork(false);
} else { } else {
LOGDEB0(("rclinit: will use vfork() for starting commands\n")); LOGDEB0("rclinit: will use vfork() for starting commands\n" );
ExecCmd::useVfork(true); ExecCmd::useVfork(true);
} }
#endif #endif
int flushmb; int flushmb;
if (config->getConfParam("idxflushmb", &flushmb) && flushmb > 0) { if (config->getConfParam("idxflushmb", &flushmb) && flushmb > 0) {
LOGDEB1(("rclinit: idxflushmb=%d, set XAPIAN_FLUSH_THRESHOLD to 10E6\n", LOGDEB1("rclinit: idxflushmb=" << (flushmb) << ", set XAPIAN_FLUSH_THRESHOLD to 10E6\n" );
flushmb));
static const char *cp = "XAPIAN_FLUSH_THRESHOLD=1000000"; static const char *cp = "XAPIAN_FLUSH_THRESHOLD=1000000";
#ifdef PUTENV_ARG_CONST #ifdef PUTENV_ARG_CONST
::putenv(cp); ::putenv(cp);
@ -390,3 +389,4 @@ bool recoll_ismainthread()
return std::this_thread::get_id() == mainthread_id; return std::this_thread::get_id() == mainthread_id;
} }

View File

@ -55,8 +55,7 @@ public:
{ {
string out; string out;
unacmaybefold(in, out, "UTF-8", m_op); unacmaybefold(in, out, "UTF-8", m_op);
LOGDEB2(("SynTermTransUnac(%d): in [%s] out [%s]\n", int(m_op), LOGDEB2("SynTermTransUnac(" << (int(m_op)) << "): in [" << (in) << "] out [" << (out) << "]\n" );
in.c_str(), out.c_str()));
return out; return out;
} }
UnacOp m_op; UnacOp m_op;
@ -68,3 +67,4 @@ extern bool createExpansionDbs(Xapian::WritableDatabase& wdb,
} }
#endif /* _EXPANSIONDBS_H_INCLUDED_ */ #endif /* _EXPANSIONDBS_H_INCLUDED_ */

View File

@ -127,8 +127,7 @@ void Query::Native::setDbWideQTermsFreqs()
for (vector<string>::const_iterator qit = qterms.begin(); for (vector<string>::const_iterator qit = qterms.begin();
qit != qterms.end(); qit++) { qit != qterms.end(); qit++) {
termfreqs[*qit] = xrdb.get_termfreq(*qit) / doccnt; termfreqs[*qit] = xrdb.get_termfreq(*qit) / doccnt;
LOGABS(("setDbWideQTermFreqs: [%s] db freq %.1e\n", qit->c_str(), LOGABS("setDbWideQTermFreqs: [" << (qit) << "] db freq " << (termfreqs[*qit]) << "\n" );
termfreqs[*qit]));
} }
} }
@ -147,7 +146,7 @@ double Query::Native::qualityTerms(Xapian::docid docid,
const vector<string>& terms, const vector<string>& terms,
multimap<double, vector<string> >& byQ) multimap<double, vector<string> >& byQ)
{ {
LOGABS(("qualityTerms\n")); LOGABS("qualityTerms\n" );
setDbWideQTermsFreqs(); setDbWideQTermsFreqs();
map<string, double> termQcoefs; map<string, double> termQcoefs;
@ -166,7 +165,7 @@ double Query::Native::qualityTerms(Xapian::docid docid,
{ {
string deb; string deb;
hld.toString(deb); hld.toString(deb);
LOGABS(("qualityTerms: hld: %s\n", deb.c_str())); LOGABS("qualityTerms: hld: " << (deb) << "\n" );
} }
#endif #endif
@ -195,7 +194,7 @@ double Query::Native::qualityTerms(Xapian::docid docid,
} }
byRootstr.append("\n"); byRootstr.append("\n");
} }
LOGABS(("\nqualityTerms: uterms to terms: %s\n", byRootstr.c_str())); LOGABS("\nqualityTerms: uterms to terms: " << (byRootstr) << "\n" );
} }
#endif #endif
@ -243,10 +242,10 @@ double Query::Native::qualityTerms(Xapian::docid docid,
#ifdef DEBUGABSTRACT #ifdef DEBUGABSTRACT
for (multimap<double, vector<string> >::reverse_iterator mit= byQ.rbegin(); for (multimap<double, vector<string> >::reverse_iterator mit= byQ.rbegin();
mit != byQ.rend(); mit++) { mit != byQ.rend(); mit++) {
LOGABS(("qualityTerms: group\n")); LOGABS("qualityTerms: group\n" );
for (vector<string>::const_iterator qit = mit->second.begin(); for (vector<string>::const_iterator qit = mit->second.begin();
qit != mit->second.end(); qit++) { qit != mit->second.end(); qit++) {
LOGABS(("%.1e->[%s]\n", mit->first, qit->c_str())); LOGABS("" << (mit->first) << "->[" << (qit) << "]\n" );
} }
} }
#endif #endif
@ -315,8 +314,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
int imaxoccs, int ictxwords) int imaxoccs, int ictxwords)
{ {
Chrono chron; Chrono chron;
LOGABS(("makeAbstract: docid %ld imaxoccs %d ictxwords %d\n", LOGABS("makeAbstract: docid " << (long(docid)) << " imaxoccs " << (imaxoccs) << " ictxwords " << (ictxwords) << "\n" );
long(docid), imaxoccs, ictxwords));
// The (unprefixed) terms matched by this document // The (unprefixed) terms matched by this document
vector<string> matchedTerms; vector<string> matchedTerms;
@ -339,7 +337,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
// aggregated by the qualityTerms() routine. // aggregated by the qualityTerms() routine.
multimap<double, vector<string> > byQ; multimap<double, vector<string> > byQ;
double totalweight = qualityTerms(docid, matchedTerms, byQ); double totalweight = qualityTerms(docid, matchedTerms, byQ);
LOGABS(("makeAbstract:%d: computed Qcoefs.\n", chron.ms())); LOGABS("makeAbstract:" << (chron.ms()) << ": computed Qcoefs.\n" );
// This can't happen, but would crash us // This can't happen, but would crash us
if (totalweight == 0.0) { if (totalweight == 0.0) {
LOGERR("makeAbstract: totalweight == 0.0 !\n" ); LOGERR("makeAbstract: totalweight == 0.0 !\n" );
@ -376,8 +374,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
const unsigned int maxtotaloccs = imaxoccs > 0 ? imaxoccs : const unsigned int maxtotaloccs = imaxoccs > 0 ? imaxoccs :
m_q->m_db->getAbsLen() /(7 * (m_q->m_db->getAbsCtxLen() + 1)); m_q->m_db->getAbsLen() /(7 * (m_q->m_db->getAbsCtxLen() + 1));
int ctxwords = ictxwords == -1 ? m_q->m_db->getAbsCtxLen() : ictxwords; int ctxwords = ictxwords == -1 ? m_q->m_db->getAbsCtxLen() : ictxwords;
LOGABS(("makeAbstract:%d: mxttloccs %d ctxwords %d\n", LOGABS("makeAbstract:" << (chron.ms()) << ": mxttloccs " << (maxtotaloccs) << " ctxwords " << (ctxwords) << "\n" );
chron.ms(), maxtotaloccs, ctxwords));
int ret = ABSRES_OK; int ret = ABSRES_OK;
@ -405,8 +402,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
string qterm = *qit; string qterm = *qit;
LOGABS(("makeAbstract: [%s] %d max grp occs (coef %.2f)\n", LOGABS("makeAbstract: [" << (qterm) << "] " << (maxgrpoccs) << " max grp occs (coef " << (q) << ")\n" );
qterm.c_str(), maxgrpoccs, q));
// The match term may span several words // The match term may span several words
int qtrmwrdcnt = int qtrmwrdcnt =
@ -425,8 +421,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
int ipos = *pos; int ipos = *pos;
if (ipos < int(baseTextPosition)) // Not in text body if (ipos < int(baseTextPosition)) // Not in text body
continue; continue;
LOGABS(("makeAbstract: [%s] at pos %d grpoccs %d maxgrpoccs" LOGABS("makeAbstract: [" << (qterm) << "] at pos " << (ipos) << " grpoccs " << (grpoccs) << " maxgrpoccs " << (maxgrpoccs) << "\n" );
" %d\n", qterm.c_str(), ipos, grpoccs, maxgrpoccs));
totaloccs++; totaloccs++;
grpoccs++; grpoccs++;
@ -466,13 +461,13 @@ int Query::Native::makeAbstract(Xapian::docid docid,
// Group done ? // Group done ?
if (grpoccs >= maxgrpoccs) { if (grpoccs >= maxgrpoccs) {
ret |= ABSRES_TRUNC; ret |= ABSRES_TRUNC;
LOGABS(("Db::makeAbstract: max group occs cutoff\n")); LOGABS("Db::makeAbstract: max group occs cutoff\n" );
break; break;
} }
// Global done ? // Global done ?
if (totaloccs >= maxtotaloccs) { if (totaloccs >= maxtotaloccs) {
ret |= ABSRES_TRUNC; ret |= ABSRES_TRUNC;
LOGABS(("Db::makeAbstract: max occurrences cutoff\n")); LOGABS("Db::makeAbstract: max occurrences cutoff\n" );
break; break;
} }
} }
@ -482,15 +477,14 @@ int Query::Native::makeAbstract(Xapian::docid docid,
if (totaloccs >= maxtotaloccs) { if (totaloccs >= maxtotaloccs) {
ret |= ABSRES_TRUNC; ret |= ABSRES_TRUNC;
LOGABS(("Db::makeAbstract: max1 occurrences cutoff\n")); LOGABS("Db::makeAbstract: max1 occurrences cutoff\n" );
break; break;
} }
} }
} }
maxpos += ctxwords + 1; maxpos += ctxwords + 1;
LOGABS(("makeAbstract:%d:chosen number of positions %d\n", LOGABS("makeAbstract:" << (chron.millis()) << ":chosen number of positions " << (totaloccs) << "\n" );
chron.millis(), totaloccs));
// This can happen if there are term occurences in the keywords // This can happen if there are term occurences in the keywords
// etc. but not elsewhere ? // etc. but not elsewhere ?
if (totaloccs == 0) { if (totaloccs == 0) {
@ -566,8 +560,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
vector<int> vpbreaks; vector<int> vpbreaks;
ndb->getPagePositions(docid, vpbreaks); ndb->getPagePositions(docid, vpbreaks);
LOGABS(("makeAbstract:%d: extracting. Got %u pages\n", chron.millis(), LOGABS("makeAbstract:" << (chron.millis()) << ": extracting. Got " << (vpbreaks.size()) << " pages\n" );
vpbreaks.size()));
// Finally build the abstract by walking the map (in order of position) // Finally build the abstract by walking the map (in order of position)
vabs.clear(); vabs.clear();
string chunk; string chunk;
@ -615,3 +608,5 @@ int Query::Native::makeAbstract(Xapian::docid docid,
} }

View File

@ -129,15 +129,14 @@ public:
m_totalterms++; m_totalterms++;
string otrm; string otrm;
if (!unacmaybefold(itrm, otrm, "UTF-8", UNACOP_UNACFOLD)) { if (!unacmaybefold(itrm, otrm, "UTF-8", UNACOP_UNACFOLD)) {
LOGDEB(("splitter::takeword: unac [%s] failed\n", itrm.c_str())); LOGDEB("splitter::takeword: unac [" << (itrm) << "] failed\n" );
m_unacerrors++; m_unacerrors++;
// We don't generate a fatal error because of a bad term, // We don't generate a fatal error because of a bad term,
// but one has to put the limit somewhere // but one has to put the limit somewhere
if (m_unacerrors > 500 && if (m_unacerrors > 500 &&
(double(m_totalterms) / double(m_unacerrors)) < 2.0) { (double(m_totalterms) / double(m_unacerrors)) < 2.0) {
// More than 1 error for every other term // More than 1 error for every other term
LOGERR(("splitter::takeword: too many unac errors %d/%d\n", LOGERR("splitter::takeword: too many unac errors " << (m_unacerrors) << "/" << (m_totalterms) << "\n" );
m_unacerrors, m_totalterms));
return false; return false;
} }
return true; return true;
@ -227,8 +226,7 @@ public:
virtual bool takeword(const string& term, int pos, int bs, int be) virtual bool takeword(const string& term, int pos, int bs, int be)
{ {
LOGDEB1(("TermProcCom::takeword: pos %d %d %d [%s]\n", LOGDEB1("TermProcCom::takeword: pos " << (pos) << " " << (bs) << " " << (be) << " [" << (term) << "]\n" );
pos, bs, be, term.c_str()));
bool isstop = m_stops.isStop(term); bool isstop = m_stops.isStop(term);
bool twogramemit = false; bool twogramemit = false;
@ -300,3 +298,4 @@ private:
} // End namespace Rcl } // End namespace Rcl
#endif /* _TERMPROC_H_INCLUDED_ */ #endif /* _TERMPROC_H_INCLUDED_ */