Commit 86b756db authored by Michael Reeves's avatar Michael Reeves

Use qC* for logging add new category

parent f9e86a1c
......@@ -20,3 +20,4 @@
#include "Logging.h"
Q_LOGGING_CATEGORY(kdiffMain, "org.kde.kdiff3")
Q_LOGGING_CATEGORY(kdiffCore, "org.kde.kdiff3.core") //very noisey
......@@ -22,4 +22,6 @@
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(kdiffMain)
Q_DECLARE_LOGGING_CATEGORY(kdiffCore) //very noisey shows internal state information for kdiffs core.
#endif // !LOGGING_H
......@@ -776,11 +776,11 @@ void SourceData::FileData::removeComments()
bool bWithinComment = false;
int size = m_unicodeBuf.length();
qDebug(kdiffMain) << "m_v.size() = " << m_v.size() << ", size = " << size;
qCDebug(kdiffCore) << "m_v.size() = " << m_v.size() << ", size = " << size;
Q_ASSERT(m_v.size() > 0);
for(int i = 0; i < size; ++i)
{
qDebug(kdiffMain) << " line= " << QString(&p[i], m_v[line].size());
qCDebug(kdiffCore) << "line= " << QString(&p[i], m_v[line].size());
bool bWhite = true;
bool bCommentInLine = false;
......
......@@ -109,7 +109,7 @@ void calcDiff3LineListUsingAB(
LineRef::LineType lineB = 0;
Diff d(0, 0, 0);
qDebug(kdiffMain) << "Enter: calcDiff3LineListUsingAB" ;
qCInfo(kdiffMain) << "Enter: calcDiff3LineListUsingAB" ;
for(;;)
{
if(d.nofEquals == 0 && d.diff1 == 0 && d.diff2 == 0)
......@@ -157,10 +157,10 @@ void calcDiff3LineListUsingAB(
Q_ASSERT(d.nofEquals >= 0);
qDebug(kdiffMain) << "lineA = " << d3l.getLineA() << "lineB = " << d3l.getLineB() ;
qCDebug(kdiffCore) << "lineA = " << d3l.getLineA() << ", lineB = " << d3l.getLineB() ;
d3ll.push_back(d3l);
}
qDebug(kdiffMain) << "Leave: calcDiff3LineListUsingAB" ;
qCInfo(kdiffMain) << "Leave: calcDiff3LineListUsingAB" ;
}
// Second step
......@@ -1340,6 +1340,7 @@ bool Diff3Line::fineDiff(bool inBTextsTotalEqual, const e_SrcSelector selector,
k2 = getLineA();
}
qDebug(kdiffCore) << "k1 = " << k1 << ", k2 = " << k2;
if((!k1.isValid() && k2.isValid()) || (k1.isValid() && !k2.isValid())) bTextsTotalEqual = false;
if(k1.isValid() && k2.isValid())
{
......
......@@ -79,7 +79,7 @@ static void debugLineCheck(Diff3LineList& d3ll, LineRef size, e_SrcSelector idx)
"If it is reproducible please contact the author.\n"),
i18n("Severe Internal Error"));
qCritical(kdiffMain) << "Severe Internal Error. Line not set for idx=" << idx << "\n";
qCCritical(kdiffMain) << "Severe Internal Error. Line not set for idx=" << idx << "\n";
::exit(-1);
}
++i;
......@@ -93,7 +93,7 @@ static void debugLineCheck(Diff3LineList& d3ll, LineRef size, e_SrcSelector idx)
"If it is reproducible please contact the author.\n"),
i18n("Severe Internal Error"));
qCritical(kdiffMain) << "Severe Internal Error.: " << size << " != " << i << "\n";
qCCritical(kdiffMain) << "Severe Internal Error.: " << size << " != " << i << "\n";
::exit(-1);
}
}
......@@ -156,7 +156,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
// First get all input data.
pp.setInformation(i18n("Loading A"));
qInfo(kdiffMain) << i18n("Loading A: ") << m_sd1.getFilename() ;
qCInfo(kdiffMain) << i18n("Loading A: %1 ", m_sd1.getFilename()) ;
if(bUseCurrentEncoding)
errors = m_sd1.readAndPreprocess(m_sd1.getEncoding(), false);
......@@ -171,7 +171,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
pp.step();
pp.setInformation(i18n("Loading B"));
qInfo(kdiffMain) << i18n("Loading B: ") << m_sd2.getFilename() ;
qCInfo(kdiffMain) << i18n("Loading B: ", m_sd2.getFilename());
if(bUseCurrentEncoding)
errors = m_sd2.readAndPreprocess(m_sd2.getEncoding(), false);
......@@ -203,14 +203,14 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
if(m_sd1.isText() && m_sd2.isText())
{
pp.setInformation(i18n("Diff: A <-> B"));
qInfo(kdiffMain) << i18n("Diff: A <-> B") ;
qCInfo(kdiffMain) << i18n("Diff: A <-> B") ;
m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, A, B,
&m_pOptionDialog->m_options);
pp.step();
pp.setInformation(i18n("Linediff: A <-> B"));
qInfo(kdiffMain) << i18n("Linediff: A <-> B") ;
qCInfo(kdiffMain) << i18n("Linediff: A <-> B") ;
calcDiff3LineListUsingAB(&m_diffList12, m_diff3LineList);
pTotalDiffStatus->bTextAEqB = m_diff3LineList.fineDiff(A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay());
if(m_sd1.getSizeBytes() == 0) pTotalDiffStatus->bTextAEqB = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment