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"
22 /** Ideally this should have been a namespace, but since we try to be
23 * compilable on older C++ compilators too, we use a struct instead.
24 * This is all the different debug levels that we have.
26 class lyx_debug_trait {
41 PARSER = (1 << 4), // 16
43 LYXRC = (1 << 5), // 32
45 KBMAP = (1 << 6), // 64
47 LATEX = (1 << 7), // 128
49 MATHED = (1 << 8), // 256 // Alejandro, please use this.
51 FONT = (1 << 9), // 512
53 TCLASS = (1 << 10), // 1024
55 LYXVC = (1 << 11), // 2048
57 LYXSERVER = (1 << 12), // 4096
59 ROFF = (1 << 13), // 8192
61 ACTION = (1 << 14), // 16384
73 INSETTEXT = (1 << 20),
88 static bool match(type a, type b) {
92 /** A function to convert symbolic string names on debug levels
93 to their numerical value.
95 static type value(std::string const & val);
97 /** Display the tags and descriptions of the current debug level
100 static void showLevel(std::ostream & o, type level);
102 /** show all the possible tags that can be used for debugging */
103 static void showTags(std::ostream & o);
110 void operator|=(lyx_debug_trait::type & d1, lyx_debug_trait::type d2)
112 d1 = static_cast<lyx_debug_trait::type>(d1 | d2);
116 // std::ostream & operator<<(std::ostream & o, Debug::type t);
118 typedef basic_debugstream<lyx_debug_trait> LyXErr;
119 typedef LyXErr::debug Debug;
121 extern LyXErr lyxerr;