Debug.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef LYXDEBUG_H
00014 #define LYXDEBUG_H
00015
00016
00017
00018
00019
00020 #if __GNUC__ > 2
00021 #define MODERN_STL_STREAMS
00022 #endif
00023
00024 #include <iosfwd>
00025
00026 #include <string>
00027
00028
00029
00030
00031
00032 using std::string;
00033
00038 struct Debug {
00040 enum type {
00042 NONE = 0,
00044 INFO = (1 << 0),
00046 INIT = (1 << 1),
00048 WARN = (1 << 2),
00050 CRIT = (1 << 3),
00052 LEVEL1 = (1 << 4),
00054 LEVEL2 = (1 << 5),
00056 LEVEL3 = (1 << 6),
00058 LEVEL4 = (1 << 7),
00060 LEVEL5 = (1 << 8),
00062 LEVEL6 = (1 << 9),
00064 LEVEL7 = (1 << 10),
00066 LEVEL8 = (1 << 11),
00068 LEVEL9 = (1 << 12),
00070 REPOSITORY = (1 << 13),
00072 SYSTEM = (1 << 14),
00074 EXCEPTION = (1 << 15)
00075
00076 };
00078 static type const ANY;
00079
00081
00082
00086 static Debug::type value(string const & val);
00087
00091 static void showLevel(std::ostream & o, type level);
00092
00094 static void showTags(std::ostream & o);
00095
00096 friend std::ostream& operator<<(std::ostream& os, Debug::type level );
00097 };
00098
00099
00100
00101 inline
00102 void operator|=(Debug::type & d1, Debug::type d2)
00103 {
00104 d1 = static_cast<Debug::type>(d1 | d2);
00105 }
00106
00107
00108 #include "DebugStream.h"
00109
00110 std::ostream & operator<<(std::ostream & o, Debug::type t);
00111
00112
00113 #endif