mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 11:08:41 +00:00
Sync with src/debug.C
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17703 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0159c9d6c7
commit
3387c00c9d
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
using lyx::support::ascii_lowercase;
|
using support::ascii_lowercase;
|
||||||
using lyx::support::bformat;
|
using support::bformat;
|
||||||
using lyx::support::isStrInt;
|
using support::isStrInt;
|
||||||
|
|
||||||
using std::setw;
|
using std::setw;
|
||||||
using std::string;
|
using std::string;
|
||||||
@ -58,8 +58,8 @@ lyx_debug_trait::type lyx_debug_trait::value(string const & val)
|
|||||||
type l = Debug::NONE;
|
type l = Debug::NONE;
|
||||||
string v(val);
|
string v(val);
|
||||||
while (!v.empty()) {
|
while (!v.empty()) {
|
||||||
string::size_type st = v.find(',');
|
string::size_type const st = v.find(',');
|
||||||
string tmp(ascii_lowercase(v.substr(0, st)));
|
string const tmp(ascii_lowercase(v.substr(0, st)));
|
||||||
if (tmp.empty())
|
if (tmp.empty())
|
||||||
break;
|
break;
|
||||||
// Is it a number?
|
// Is it a number?
|
||||||
@ -86,12 +86,10 @@ void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level)
|
|||||||
if (errorTags[i].level != Debug::ANY
|
if (errorTags[i].level != Debug::ANY
|
||||||
&& errorTags[i].level != Debug::NONE
|
&& errorTags[i].level != Debug::NONE
|
||||||
&& errorTags[i].level & level) {
|
&& errorTags[i].level & level) {
|
||||||
// avoid _(...) re-entrance problem
|
// avoid to_utf8(_(...)) re-entrance problem
|
||||||
// FIXME: should we use _() from gettext.h here?
|
docstring const s = _(errorTags[i].desc);
|
||||||
lyx::docstring const s = _(errorTags[i].desc);
|
os << to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
|
||||||
os << lyx::to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
|
from_utf8(errorTags[i].name), s))
|
||||||
lyx::from_utf8(errorTags[i].name),
|
|
||||||
s))
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,12 +100,13 @@ void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level)
|
|||||||
void lyx_debug_trait::showTags(ostream & os)
|
void lyx_debug_trait::showTags(ostream & os)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < numErrorTags ; ++i)
|
for (int i = 0; i < numErrorTags ; ++i)
|
||||||
os << setw(7) << static_cast<unsigned int>(errorTags[i].level)
|
os << setw(10) << static_cast<unsigned int>(errorTags[i].level)
|
||||||
<< setw(10) << errorTags[i].name
|
<< setw(13) << errorTags[i].name
|
||||||
<< " " << lyx::to_utf8(_(errorTags[i].desc)) << '\n';
|
<< " " << to_utf8(_(errorTags[i].desc)) << '\n';
|
||||||
os.flush();
|
os.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LyXErr lyxerr;
|
LyXErr lyxerr;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user