4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
16 #include "support/debugstream.h"
17 #include "support/docstring.h"
19 /** Ideally this should have been a namespace, but since we try to be
20 * compilable on older C++ compilators too, we use a struct instead.
21 * This is all the different debug levels that we have.
23 class lyx_debug_trait {
38 PARSER = (1 << 4), // 16
40 LYXRC = (1 << 5), // 32
42 KBMAP = (1 << 6), // 64
44 LATEX = (1 << 7), // 128
46 MATHED = (1 << 8), // 256 // Alejandro, please use this.
48 FONT = (1 << 9), // 512
50 TCLASS = (1 << 10), // 1024
52 LYXVC = (1 << 11), // 2048
54 LYXSERVER = (1 << 12), // 4096
56 ROFF = (1 << 13), // 8192
58 ACTION = (1 << 14), // 16384
70 INSETTEXT = (1 << 20),
85 static bool match(type a, type b) {
89 /** A function to convert symbolic string names on debug levels
90 to their numerical value.
92 static type value(std::string const & val);
94 /** Display the tags and descriptions of the current debug level
97 static void showLevel(std::ostream & o, type level);
99 /** show all the possible tags that can be used for debugging */
100 static void showTags(std::ostream & o);
107 void operator|=(lyx_debug_trait::type & d1, lyx_debug_trait::type d2)
109 d1 = static_cast<lyx_debug_trait::type>(d1 | d2);
113 // std::ostream & operator<<(std::ostream & o, Debug::type t);
115 typedef basic_debugstream<lyx_debug_trait> LyXErr;
116 typedef LyXErr::debug Debug;
118 extern LyXErr lyxerr;