convenience.h
Go to the documentation of this file.
00001 #ifndef LOG4CPP_CONVENIENCE_H
00002 #define LOG4CPP_CONVENIENCE_H
00003 
00004 #define LOG4CPP_LOGGER(name) \
00005   static log4cpp::Category& logger = log4cpp::Category::getInstance( name );
00006 
00007 #define LOG4CPP_LOGGER_N(var_name, name) \
00008   static log4cpp::Category& var_name = log4cpp::Category::getInstance( name );
00009 
00010 // simple logging
00011 #define LOG4CPP_EMERG(logger, msg) \
00012    if (logger.isEmergEnabled()) logger.emerg( msg );
00013 
00014 #define LOG4CPP_FATAL(logger, msg) \
00015    if (logger.isFatalEnabled()) logger.fatal( msg );
00016 
00017 #define LOG4CPP_ALERT(logger, msg) \
00018    if (logger.isAlertEnabled()) logger.alert( msg );
00019 
00020 #define LOG4CPP_CRIT(logger, msg) \
00021    if (logger.isCritEnabled()) logger.crit( msg );
00022 
00023 #define LOG4CPP_ERROR(logger, msg) \
00024    if (logger.isErrorEnabled()) logger.error( msg );
00025 
00026 #define LOG4CPP_WARN(logger, msg) \
00027    if (logger.isWarnEnabled()) logger.warn( msg );
00028 
00029 #define LOG4CPP_NOTICE(logger, msg) \
00030    if (logger.isNoticeEnabled()) logger.notice( msg );
00031 
00032 #define LOG4CPP_INFO(logger, msg) \
00033    if (logger.isInfoEnabled()) logger.info( msg );
00034 
00035 #define LOG4CPP_DEBUG(logger, msg) \
00036    if (logger.isDebugEnabled()) logger.debug( msg );
00037 
00038 
00039 // stream logging
00040 #define LOG4CPP_EMERG_S(logger) \
00041    if (logger.isEmergEnabled()) logger.emergStream()
00042 
00043 #define LOG4CPP_FATAL_S(logger) \
00044    if (logger.isFatalEnabled()) logger.fatalStream()
00045 
00046 #define LOG4CPP_ALERT_S(logger) \
00047    if (logger.isAlertEnabled()) logger.alertStream()
00048 
00049 #define LOG4CPP_CRIT_S(logger) \
00050    if (logger.isCritEnabled()) logger.critStream()
00051 
00052 #define LOG4CPP_ERROR_S(logger) \
00053    if (logger.isErrorEnabled()) logger.errorStream()
00054 
00055 #define LOG4CPP_WARN_S(logger) \
00056    if (logger.isWarnEnabled()) logger.warnStream()
00057 
00058 #define LOG4CPP_NOTICE_S(logger) \
00059    if (logger.isNoticeEnabled()) logger.noticeStream()
00060 
00061 #define LOG4CPP_INFO_S(logger) \
00062    if (logger.isInfoEnabled()) logger.infoStream()
00063 
00064 #define LOG4CPP_DEBUG_S(logger) \
00065    if (logger.isDebugEnabled()) logger.debugStream()
00066 
00067 
00068 // stream logging with default logger "logger"
00069 #define LOG4CPP_EMERG_SD() \
00070    if (logger.isEmergEnabled()) logger.emergStream()
00071 
00072 #define LOG4CPP_FATAL_SD() \
00073    if (logger.isFatalEnabled()) logger.fatalStream()
00074 
00075 #define LOG4CPP_ALERT_SD() \
00076    if (logger.isAlertEnabled()) logger.alertStream()
00077 
00078 #define LOG4CPP_CRIT_SD() \
00079    if (logger.isCritEnabled()) logger.critStream()
00080 
00081 #define LOG4CPP_ERROR_SD() \
00082    if (logger.isErrorEnabled()) logger.errorStream()
00083 
00084 #define LOG4CPP_WARN_SD() \
00085    if (logger.isWarnEnabled()) logger.warnStream()
00086 
00087 #define LOG4CPP_NOTICE_SD() \
00088    if (logger.isNoticeEnabled()) logger.noticeStream()
00089 
00090 #define LOG4CPP_INFO_SD() \
00091    if (logger.isInfoEnabled()) logger.infoStream()
00092 
00093 #define LOG4CPP_DEBUG_SD() \
00094    if (logger.isDebugEnabled()) logger.debugStream()
00095 
00096 #endif
00097 


log4cpp
Author(s): Stephen Roderick
autogenerated on Mon Oct 6 2014 03:13:14