00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef HH_SENF_Utils_Logger_Definitions_
00027 #define HH_SENF_Utils_Logger_Definitions_ 1
00028
00029
00030
00031
00032 #include "Definitions.ih"
00033
00034
00035 namespace senf {
00036 namespace log {
00037
00039
00041
00042
00059 # define SENF_LOG_DEFINE_STREAM(stream, defaultLevel_, runtimeLimit_, compileLimit_) \
00060 struct stream \
00061 : public senf::log::detail::StreamBase, public senf::singleton<stream> \
00062 { \
00063 typedef defaultLevel_ defaultLevel; \
00064 typedef runtimeLimit_ runtimeLimit; \
00065 typedef compileLimit_ compileLimit; \
00066 static std::string name() { return instance().v_name(); } \
00067 unsigned defaultRuntimeLimit() const { return runtimeLimit::value; } \
00068 using senf::singleton<stream>::instance; \
00069 private: \
00070 stream() { init(); } \
00071 friend class senf::singleton<stream>; \
00072 }
00073
00080 # define SENF_LOG_DEFINE_AREA(area) SENF_LOG_DEFINE_AREA_I(area, ; )
00081
00089
00090 # define SENF_LOG_CLASS_AREA() \
00091 SENF_LOG_DEFINE_AREA_I( \
00092 SENFLogArea, \
00093 std::string v_name() const \
00094 { std::string s (fullName()); return std::string(s,0,s.size()-13); }); \
00095 SENF_LOG_DEFAULT_AREA(SENFLogArea)
00096
00097
00105 # define SENF_LOG_DEFINE_ALIAS(alias,args) \
00106 struct alias : public senf::log::detail::AliasBase \
00107 { \
00108 template <class Base> \
00109 struct apply \
00110 { \
00111 typedef typename SENF_LOG_MERGE_PARAMETERS_I(Base,args) type; \
00112 }; \
00113 }
00114
00116 SENF_LOG_DEFINE_STREAM(Debug, MESSAGE, MESSAGE, NOTICE);
00117
00119 SENF_LOG_DEFINE_AREA(DefaultArea);
00120
00121
00122
00123
00124 }}
00125
00126
00127
00128
00129
00130 #endif
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141