logging now uses c++ streams
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "confgui.h"
|
||||
#include "smallut.h"
|
||||
#include "debuglog.h"
|
||||
#include "log.h"
|
||||
#include "rcldb.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
@@ -376,7 +376,7 @@ void ConfParamSLW::showInputDialog()
|
||||
void ConfParamSLW::listToConf()
|
||||
{
|
||||
list<string> ls;
|
||||
LOGDEB2(("ConfParamSLW::listToConf. m_fsencoding %d\n", int(m_fsencoding)));
|
||||
LOGDEB2("ConfParamSLW::listToConf. m_fsencoding " << (int(m_fsencoding)) << "\n" );
|
||||
for (int i = 0; i < m_lb->count(); i++) {
|
||||
// General parameters are encoded as utf-8. File names as
|
||||
// local8bit There is no hope for 8bit file names anyway
|
||||
@@ -423,7 +423,7 @@ void ConfParamSLW::deleteSelected()
|
||||
}
|
||||
for (vector<int>::reverse_iterator it = idxes.rbegin();
|
||||
it != idxes.rend(); it++) {
|
||||
LOGDEB0(("deleteSelected: %d was selected\n", *it));
|
||||
LOGDEB0("deleteSelected: " << (*it) << " was selected\n" );
|
||||
QListWidgetItem *item = m_lb->takeItem(*it);
|
||||
emit entryDeleted(item->text());
|
||||
delete item;
|
||||
@@ -476,3 +476,4 @@ void ConfParamCSLW::showInputDialog()
|
||||
}
|
||||
|
||||
} // Namespace confgui
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ using std::list;
|
||||
#include "recoll.h"
|
||||
#include "confguiindex.h"
|
||||
#include "smallut.h"
|
||||
#include "debuglog.h"
|
||||
#include "log.h"
|
||||
#include "rcldb.h"
|
||||
#include "conflinkrcl.h"
|
||||
#include "execmd.h"
|
||||
@@ -68,9 +68,9 @@ ConfIndexW::ConfIndexW(QWidget *parent, RclConfig *config)
|
||||
|
||||
void ConfIndexW::acceptChanges()
|
||||
{
|
||||
LOGDEB(("ConfIndexW::acceptChanges()\n"));
|
||||
LOGDEB("ConfIndexW::acceptChanges()\n" );
|
||||
if (!m_conf) {
|
||||
LOGERR(("ConfIndexW::acceptChanges: no config\n"));
|
||||
LOGERR("ConfIndexW::acceptChanges: no config\n" );
|
||||
return;
|
||||
}
|
||||
// Let the changes to disk
|
||||
@@ -88,7 +88,7 @@ void ConfIndexW::acceptChanges()
|
||||
|
||||
void ConfIndexW::rejectChanges()
|
||||
{
|
||||
LOGDEB(("ConfIndexW::rejectChanges()\n"));
|
||||
LOGDEB("ConfIndexW::rejectChanges()\n" );
|
||||
// Discard local changes.
|
||||
delete m_conf;
|
||||
m_conf = 0;
|
||||
@@ -477,7 +477,7 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
|
||||
string cmd = "iconv";
|
||||
int status = ex.doexec(cmd, args, 0, &icout);
|
||||
if (status) {
|
||||
LOGERR(("Can't get list of charsets from 'iconv -l'"));
|
||||
LOGERR("Can't get list of charsets from 'iconv -l'" );
|
||||
}
|
||||
icout = neutchars(icout, ",");
|
||||
list<string> ccsets;
|
||||
@@ -579,7 +579,7 @@ void ConfSubPanelW::reloadAll()
|
||||
|
||||
void ConfSubPanelW::subDirChanged(QListWidgetItem *current, QListWidgetItem *)
|
||||
{
|
||||
LOGDEB(("ConfSubPanelW::subDirChanged\n"));
|
||||
LOGDEB("ConfSubPanelW::subDirChanged\n" );
|
||||
|
||||
if (current == 0 || current->text() == "") {
|
||||
m_sk = "";
|
||||
@@ -588,13 +588,13 @@ void ConfSubPanelW::subDirChanged(QListWidgetItem *current, QListWidgetItem *)
|
||||
m_sk = (const char *) current->text().toUtf8();
|
||||
m_groupbox->setTitle(current->text());
|
||||
}
|
||||
LOGDEB(("ConfSubPanelW::subDirChanged: now [%s]\n", m_sk.c_str()));
|
||||
LOGDEB("ConfSubPanelW::subDirChanged: now [" << (m_sk) << "]\n" );
|
||||
reloadAll();
|
||||
}
|
||||
|
||||
void ConfSubPanelW::subDirDeleted(QString sbd)
|
||||
{
|
||||
LOGDEB(("ConfSubPanelW::subDirDeleted(%s)\n", (const char *)sbd.toUtf8()));
|
||||
LOGDEB("ConfSubPanelW::subDirDeleted(" << ((const char *)sbd.toUtf8()) << ")\n" );
|
||||
if (sbd == "") {
|
||||
// Can't do this, have to reinsert it
|
||||
QTimer::singleShot(0, this, SLOT(restoreEmpty()));
|
||||
@@ -606,8 +606,9 @@ void ConfSubPanelW::subDirDeleted(QString sbd)
|
||||
|
||||
void ConfSubPanelW::restoreEmpty()
|
||||
{
|
||||
LOGDEB(("ConfSubPanelW::restoreEmpty()\n"));
|
||||
LOGDEB("ConfSubPanelW::restoreEmpty()\n" );
|
||||
m_subdirs->getListBox()->insertItem(0, "");
|
||||
}
|
||||
|
||||
} // Namespace confgui
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
#include "confgui.h"
|
||||
#include "conftree.h"
|
||||
#include "debuglog.h"
|
||||
#include "log.h"
|
||||
|
||||
namespace confgui {
|
||||
|
||||
@@ -42,10 +42,10 @@ public:
|
||||
{
|
||||
if (!m_conf)
|
||||
return false;
|
||||
LOGDEB1(("Setting [%s] value to [%s]\n", m_nm.c_str(), val.c_str()));
|
||||
LOGDEB1("Setting [" << (m_nm) << "] value to [" << (val) << "]\n" );
|
||||
bool ret = m_conf->set(m_nm, val, m_sk?*m_sk:"");
|
||||
if (!ret)
|
||||
LOGERR(("Value set failed\n"));
|
||||
LOGERR("Value set failed\n" );
|
||||
return ret;
|
||||
}
|
||||
virtual bool get(string& val)
|
||||
@@ -53,9 +53,7 @@ public:
|
||||
if (!m_conf)
|
||||
return false;
|
||||
bool ret = m_conf->get(m_nm, val, m_sk?*m_sk:"");
|
||||
LOGDEB1(("ConfLinkRcl::get: [%s] sk [%s] -> [%s]\n",
|
||||
m_nm.c_str(), m_sk?m_sk->c_str():"",
|
||||
ret ? val.c_str() : "no value"));
|
||||
LOGDEB1("ConfLinkRcl::get: [" << (m_nm) << "] sk [" << (m_sk?m_sk:"") << "] -> [" << (ret ? val : "no value") << "]\n" );
|
||||
return ret;
|
||||
}
|
||||
private:
|
||||
@@ -67,3 +65,4 @@ private:
|
||||
} // Namespace confgui
|
||||
|
||||
#endif /* _CONFLINKRCL_H_INCLUDED_ */
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ using namespace std;
|
||||
|
||||
#include "pathut.h"
|
||||
#include "confguiindex.h"
|
||||
#include "debuglog.h"
|
||||
#include "log.h"
|
||||
#include "rclconfig.h"
|
||||
#include "execmd.h"
|
||||
#include "conflinkrcl.h"
|
||||
@@ -89,9 +89,6 @@ int main(int argc, char **argv)
|
||||
argc--; argv++;
|
||||
}
|
||||
|
||||
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
||||
DebugLog::setfilename("stderr");
|
||||
|
||||
string a_config = "tstconfdir";
|
||||
config = new RclConfig(&a_config);
|
||||
if (config == 0 || !config->ok()) {
|
||||
@@ -130,3 +127,4 @@ int main(int argc, char **argv)
|
||||
// Let's go
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user