28 #if !defined(__CINT__) && !defined(__MAKECINT__) 29 #include "log4cpp/Category.hh" 30 #include "log4cpp/Appender.hh" 31 #include "log4cpp/OstreamAppender.hh" 32 #include "log4cpp/BasicLayout.hh" 33 #include "log4cpp/Priority.hh" 57 #define pFATAL log4cpp::Priority::FATAL 58 #define pALERT log4cpp::Priority::ALERT 59 #define pCRIT log4cpp::Priority::CRIT 60 #define pERROR log4cpp::Priority::ERROR 61 #define pWARN log4cpp::Priority::WARN 62 #define pNOTICE log4cpp::Priority::NOTICE 63 #define pINFO log4cpp::Priority::INFO 64 #define pDEBUG log4cpp::Priority::DEBUG 68 #ifdef __GENIE_USES_LOG4CPP_VERSION__ 69 #if __GENIE_USES_LOG4CPP_VERSION__==0 70 #define ENDL log4cpp::CategoryStream::ENDLINE 72 #define ENDL std::endl 75 #define ENDL std::endl 85 #define SLOG(stream, priority) \ 86 (*Messenger::Instance())(stream) \ 87 << priority << "[s] <" \ 88 << __FUNCTION__ << " (" << __LINE__ << ")> : " 97 #define LOG(stream, priority) \ 98 (*Messenger::Instance())(stream) \ 99 << priority << "[n] <" \ 100 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 111 #ifndef HIDE_GENIE_MSG_LOG_MACROS 113 #ifndef HIDE_GENIE_LOG_XXX 114 #define LOG_FATAL(stream) \ 115 (*Messenger::Instance())(stream) \ 116 << log4cpp::Priority::FATAL << "[n] <" \ 117 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 119 #define LOG_ALERT(stream) \ 120 (*Messenger::Instance())(stream) \ 121 << log4cpp::Priority::ALERT << "[n] <" \ 122 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 124 #define LOG_CRIT(stream) \ 125 (*Messenger::Instance())(stream) \ 126 << log4cpp::Priority::CRIT << "[n] <" \ 127 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 129 #define LOG_ERROR(stream) \ 130 (*Messenger::Instance())(stream) \ 131 << log4cpp::Priority::ERROR << "[n] <" \ 132 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 134 #define LOG_WARN(stream) \ 135 (*Messenger::Instance())(stream) \ 136 << log4cpp::Priority::WARN << "[n] <" \ 137 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 139 #define LOG_NOTICE(stream) \ 140 (*Messenger::Instance())(stream) \ 141 << log4cpp::Priority::NOTICE << "[n] <" \ 142 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 144 #define LOG_INFO(stream) \ 145 (*Messenger::Instance())(stream) \ 146 << log4cpp::Priority::INFO << "[n] <" \ 147 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 149 #define LOG_DEBUG(stream) \ 150 (*Messenger::Instance())(stream) \ 151 << log4cpp::Priority::DEBUG << "[n] <" \ 152 << __FILE__ << "::" << __FUNCTION__ << " (" << __LINE__ << ")> : " 155 #endif // HIDE_GENIE_MSG_LOG_MACROS 164 #define LLOG(stream, priority) \ 165 (*Messenger::Instance())(stream) \ 166 << priority << "[l] <" \ 167 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 169 #define LLOG_FATAL(stream) \ 170 (*Messenger::Instance())(stream) \ 171 << log4cpp::Priority::FATAL << "[l] <" \ 172 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 174 #define LLOG_ALERT(stream) \ 175 (*Messenger::Instance())(stream) \ 176 << log4cpp::Priority::ALERT << "[l] <" \ 177 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 179 #define LLOG_CRIT(stream) \ 180 (*Messenger::Instance())(stream) \ 181 << log4cpp::Priority::CRIT << "[l] <" \ 182 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 184 #define LLOG_ERROR(stream) \ 185 (*Messenger::Instance())(stream) \ 186 << log4cpp::Priority::ERROR << "[l] <" \ 187 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 189 #define LLOG_WARN(stream) \ 190 (*Messenger::Instance())(stream) \ 191 << log4cpp::Priority::WARN << "'[l] <" \ 192 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 194 #define LLOG_NOTICE(stream) \ 195 (*Messenger::Instance())(stream) \ 196 << log4cpp::Priority::NOTICE << "[l] <" \ 197 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 199 #define LLOG_INFO(stream) \ 200 (*Messenger::Instance())(stream) \ 201 << log4cpp::Priority::INFO << "[l] <" \ 202 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 204 #define LLOG_DEBUG(stream) \ 205 (*Messenger::Instance())(stream) \ 206 << log4cpp::Priority::DEBUG << "[l] <" \ 207 << __PRETTY_FUNCTION__ << " (" << __LINE__ << ")> : " 215 #define BLOG(stream, priority) \ 216 (*Messenger::Instance())(stream) << priority 232 #define TOKCAT(x,y) x##y 234 #define TOKCAT2(x,y) TOKCAT(x,y) 236 #define LINECAT(x) TOKCAT2(x, __LINE__ ) 238 #define MAXSLOG(s,l,c) \ 239 static int LINECAT(MSGCNT) = 0; \ 240 const char* LINECAT(MSGADD) = (++LINECAT(MSGCNT)==c) ? "..Last Message .. " : ""; \ 241 if (LINECAT(MSGCNT) > c || LINECAT(MSGCNT) < 0) \ 242 {;} else SLOG(s,l) << LINECAT(MSGADD) 244 #define MAXLOG(s,l,c) \ 245 static int LINECAT(MSGCNT) = 0; \ 246 const char* LINECAT(MSGADD) = (++LINECAT(MSGCNT)==c) ? "..Last Message .. " : ""; \ 247 if (LINECAT(MSGCNT) > c || LINECAT(MSGCNT) < 0) \ 248 {;} else LOG(s,l) << LINECAT(MSGADD) 250 #define MAXLLOG(s,l,c) \ 251 static int LINECAT(MSGCNT) = 0; \ 252 const char* LINECAT(MSGADD) = (++LINECAT(MSGCNT)==c) ? "..Last Message .. " : ""; \ 253 if (LINECAT(MSGCNT) > c || LINECAT(MSGCNT) < 0) \ 254 {;} else LLOG(s,l) << LINECAT(MSGADD) 266 log4cpp::Category & operator () (
const char *
stream);
267 void SetPriorityLevel(
const char * stream, log4cpp::Priority::Value
p);
269 bool SetPrioritiesFromXmlFile(
string filename);
280 log4cpp::Priority::Value PriorityFromString(
string priority);
285 if (Messenger::fInstance !=0) {
286 delete Messenger::fInstance;
287 Messenger::fInstance = 0;
295 #endif // _MESSENGER_H_
THE MAIN GENIE PROJECT NAMESPACE
void DummyMethodAndSilentCompiler()
A more convenient interface to the log4cpp Message Service.
void Configure(string mesg)
static Messenger * fInstance