00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef BTK_IO_LOGGER_LEVEL_HPP
00025 #define BTK_IO_LOGGER_LEVEL_HPP
00026
00027 namespace BTK {
00028 namespace IO {
00029 namespace LOGGING {
00030
00057 class LoggerLevel
00058 {
00059 public:
00061 LoggerLevel() : _lvl(0), _src(0) {}
00062
00064 LoggerLevel(unsigned l,unsigned s) : _lvl(l), _src(s) {}
00065
00067 const LoggerLevel operator|(LoggerLevel const & rhs) const
00068 {
00069 return LoggerLevel((_lvl | rhs._lvl), (_src | rhs._src));
00070 }
00071
00073 const LoggerLevel operator&(LoggerLevel const & rhs) const
00074 {
00075 return LoggerLevel((_lvl & rhs._lvl), (_src & rhs._src));
00076 }
00077
00079 operator bool() const
00080 {
00081 return (static_cast<bool>(_lvl) && static_cast<bool>(_src));
00082 }
00083
00084 private:
00085 unsigned _lvl;
00086 unsigned _src;
00087 };
00088
00089 const unsigned ALL(static_cast<unsigned>(-1));
00090
00092
00093 static const LoggerLevel ERROR(1,ALL);
00094 static const LoggerLevel WARNING(2,ALL);
00095 static const LoggerLevel TRACE(4,ALL);
00096 static const LoggerLevel DEBUG(8,ALL);
00097
00098 static const LoggerLevel ALL_LEVELS(ALL,ALL);
00099
00100
00102
00103 static const LoggerLevel ATOMS(ALL,1);
00104 static const LoggerLevel CONTAINERS(ALL,2);
00105 static const LoggerLevel ITERATORS(ALL,4);
00106 static const LoggerLevel ALGORITHMS(ALL,8);
00107 static const LoggerLevel IO(ALL,16);
00108 static const LoggerLevel MATH(ALL,32);
00109 static const LoggerLevel UTILITY(ALL,64);
00110
00111 static const LoggerLevel ALL_SOURCES(ALL,ALL);
00112
00113
00115 static const LoggerLevel NOTHING(0,0);
00116
00118 static const LoggerLevel EVERYTHING(ALL,ALL);
00119
00120 }
00121 }
00122 }
00123
00124 #endif