X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fdebug.C;h=8506660b23eec94add1689103ad05999c222a1ae;hb=c0eb43a927a49e054afbdf37e50387065c3d99a4;hp=6c2029a18f19b9a2463ce23a07cae0284074b7f6;hpb=a32d2c972f88e771a326e011bc16b6d38d6e9082;p=lyx.git diff --git a/src/debug.C b/src/debug.C index 6c2029a18f..8506660b23 100644 --- a/src/debug.C +++ b/src/debug.C @@ -1,9 +1,9 @@ /* This file is part of -* ====================================================== -* +* ====================================================== +* * LyX, The Document Processor -* -* Copyright 1999-2000 The LyX Team. +* +* Copyright 1999-2001 The LyX Team. * * ====================================================== */ @@ -17,18 +17,22 @@ #include "debug.h" #include "gettext.h" +#include "support/lstrings.h" using std::ostream; using std::setw; using std::endl; +namespace { + struct error_item { Debug::type level; char const * name; char const * desc; }; -static error_item errorTags[] = { + +error_item errorTags[] = { { Debug::NONE, "none", N_("No debugging message")}, { Debug::INFO, "info", N_("General information")}, { Debug::INIT, "init", N_("Program initialisation")}, @@ -49,36 +53,42 @@ static error_item errorTags[] = { { Debug::DEPEND, "depend", N_("Dependency information")}, { Debug::INSETS, "insets", N_("LyX Insets")}, { Debug::FILES, "files", N_("Files used by LyX")}, - { Debug::ANY, "any", N_("All debugging messages")} + { Debug::WORKAREA, "workarea", N_("Workarea events")}, + { Debug::INSETTEXT, "insettext", N_("Insettext/tabular messages")}, + { Debug::GRAPHICS, "graphics", N_("Graphics conversion and loading")}, + { Debug::ANY, "any", N_("All debugging messages")} }; -static const int numErrorTags = sizeof(errorTags)/sizeof(error_item); +int const numErrorTags = sizeof(errorTags)/sizeof(error_item); + +} // namespace anon + - Debug::type const Debug::ANY = Debug::type( Debug::INFO | Debug::INIT | Debug::KEY | Debug::GUI | Debug::PARSER | Debug::LYXRC | Debug::KBMAP | Debug::LATEX | Debug::MATHED | Debug::FONT | Debug::TCLASS | Debug::LYXVC | Debug::LYXSERVER | Debug::ROFF | Debug::ACTION | Debug::LYXLEX | - Debug::DEPEND | Debug::INSETS | Debug::FILES); + Debug::DEPEND | Debug::INSETS | Debug::FILES | Debug::WORKAREA | + Debug::INSETTEXT | Debug::GRAPHICS); -Debug::type Debug::value(string const & val) +Debug::type Debug::value(string const & val) { type l = Debug::NONE; string v(val); while (!v.empty()) { string::size_type st = v.find(','); - string tmp(lowercase(v.substr(0, st))); + string tmp(ascii_lowercase(v.substr(0, st))); if (tmp.empty()) break; // Is it a number? - if (isStrInt(tmp)) + if (isStrInt(tmp)) l |= static_cast(strToInt(tmp)); else // Search for an explicit name - for (int i = 0 ; i < numErrorTags ; ++i) + for (int i = 0 ; i < numErrorTags ; ++i) if (tmp == errorTags[i].name) { l |= errorTags[i].level; break; @@ -102,7 +112,7 @@ void Debug::showLevel(ostream & o, Debug::type level) } -void Debug::showTags(ostream & os) +void Debug::showTags(ostream & os) { for (int i = 0 ; i < numErrorTags ; ++i) os << setw(7) << errorTags[i].level