Make code easier to debug
This commit is contained in:
parent
35b94a1810
commit
c9e2b56b08
|
@ -975,8 +975,10 @@ void CppCheckExecutor::reportErr(const std::string &errmsg)
|
||||||
_errorList.insert(errmsg);
|
_errorList.insert(errmsg);
|
||||||
if (errorOutput)
|
if (errorOutput)
|
||||||
*errorOutput << errmsg << std::endl;
|
*errorOutput << errmsg << std::endl;
|
||||||
else
|
else {
|
||||||
std::cerr << ansiToOEM(errmsg, _settings ? !_settings->xml : true) << std::endl;
|
const bool doConvert = (_settings == nullptr) ? true : !_settings->xml;
|
||||||
|
std::cerr << ansiToOEM(errmsg, doConvert) << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCheckExecutor::reportOut(const std::string &outmsg)
|
void CppCheckExecutor::reportOut(const std::string &outmsg)
|
||||||
|
@ -1016,9 +1018,9 @@ void CppCheckExecutor::reportStatus(std::size_t fileindex, std::size_t filecount
|
||||||
{
|
{
|
||||||
if (filecount > 1) {
|
if (filecount > 1) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
const long percentDone = (sizetotal > 0) ? static_cast<long>(static_cast<long double>(sizedone) / sizetotal * 100) : 0;
|
||||||
oss << fileindex << '/' << filecount
|
oss << fileindex << '/' << filecount
|
||||||
<< " files checked " <<
|
<< " files checked " << percentDone
|
||||||
(sizetotal > 0 ? static_cast<long>(static_cast<long double>(sizedone) / sizetotal*100) : 0)
|
|
||||||
<< "% done";
|
<< "% done";
|
||||||
std::cout << oss.str() << std::endl;
|
std::cout << oss.str() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue