Add config option to redirect external helpers error output to a file
This commit is contained in:
parent
a4b3aff5c4
commit
ae2b4577c3
@ -162,7 +162,11 @@ bool MimeHandlerExec::next_document()
|
||||
mexec.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
|
||||
"RECOLL_FILTER_FORPREVIEW=no");
|
||||
mexec.setrlimit_as(m_filtermaxmbytes);
|
||||
|
||||
std::string errfile;
|
||||
m_config->getConfParam("helperlogfilename", errfile);
|
||||
if (!errfile.empty()) {
|
||||
mexec.setStderr(errfile);
|
||||
}
|
||||
int status;
|
||||
try {
|
||||
status = mexec.doexec(cmd, myparams, 0, &output);
|
||||
|
||||
@ -63,6 +63,11 @@ bool MimeHandlerExecMultiple::startCmd()
|
||||
m_cmd.setrlimit_as(m_filtermaxmbytes);
|
||||
m_adv.setmaxsecs(m_filtermaxseconds);
|
||||
m_cmd.setAdvise(&m_adv);
|
||||
std::string errfile;
|
||||
m_config->getConfParam("helperlogfilename", errfile);
|
||||
if (!errfile.empty()) {
|
||||
m_cmd.setStderr(errfile);
|
||||
}
|
||||
|
||||
// Build parameter list: delete cmd name
|
||||
vector<string>myparams(params.begin() + 1, params.end());
|
||||
|
||||
@ -660,6 +660,17 @@ logfilename = stderr
|
||||
# <brief>Override logfilename for the indexer.</brief><descr></descr></var>
|
||||
#idxlogfilename = stderr
|
||||
|
||||
# <var name="helperlogfilename" type="fn">
|
||||
#
|
||||
# <brief>Destination file for external helpers standard error
|
||||
# output.</brief>
|
||||
#
|
||||
# <descr>The external program error output is left alone by default,
|
||||
# e.g. going to the terminal when the recoll[index] program is executed
|
||||
# from the command line. Use /dev/null or a file inside a non-existent
|
||||
# directory to completely suppress the output.</brief></var>
|
||||
#helperlogfilename=
|
||||
|
||||
# <var name="daemloglevel" type="int">
|
||||
#
|
||||
# <brief>Override loglevel for the indexer in real time
|
||||
|
||||
@ -168,7 +168,7 @@ public:
|
||||
bool waitIdle() {
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
if (!ok()) {
|
||||
LOGERR("WorkQueue::waitIdle:" << m_name << ": not ok\n");
|
||||
LOGINF("WorkQueue::waitIdle:" << m_name << ": queue already closed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user