convenience.h
Go to the documentation of this file.
1 /*
2  * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
3  * Copyright 2002, Bastiaan Bakker. All rights reserved.
4  *
5  * See the COPYING file for the terms of usage and distribution.
6  */
7 
8 #ifndef LOG4CPP_CONVENIENCE_H
9 #define LOG4CPP_CONVENIENCE_H
10 
11 #define LOG4CPP_LOGGER(name) \
12  static log4cpp::Category& logger = log4cpp::Category::getInstance( name );
13 
14 #define LOG4CPP_LOGGER_N(var_name, name) \
15  static log4cpp::Category& var_name = log4cpp::Category::getInstance( name );
16 
17 // simple logging
18 #define LOG4CPP_EMERG(logger, msg) \
19  if (logger.isEmergEnabled()) logger.emerg( msg );
20 
21 #define LOG4CPP_FATAL(logger, msg) \
22  if (logger.isFatalEnabled()) logger.fatal( msg );
23 
24 #define LOG4CPP_ALERT(logger, msg) \
25  if (logger.isAlertEnabled()) logger.alert( msg );
26 
27 #define LOG4CPP_CRIT(logger, msg) \
28  if (logger.isCritEnabled()) logger.crit( msg );
29 
30 #define LOG4CPP_ERROR(logger, msg) \
31  if (logger.isErrorEnabled()) logger.error( msg );
32 
33 #define LOG4CPP_WARN(logger, msg) \
34  if (logger.isWarnEnabled()) logger.warn( msg );
35 
36 #define LOG4CPP_NOTICE(logger, msg) \
37  if (logger.isNoticeEnabled()) logger.notice( msg );
38 
39 #define LOG4CPP_INFO(logger, msg) \
40  if (logger.isInfoEnabled()) logger.info( msg );
41 
42 #define LOG4CPP_DEBUG(logger, msg) \
43  if (logger.isDebugEnabled()) logger.debug( msg );
44 
45 
46 // stream logging
47 #define LOG4CPP_EMERG_S(logger) \
48  if (logger.isEmergEnabled()) logger.emergStream()
49 
50 #define LOG4CPP_FATAL_S(logger) \
51  if (logger.isFatalEnabled()) logger.fatalStream()
52 
53 #define LOG4CPP_ALERT_S(logger) \
54  if (logger.isAlertEnabled()) logger.alertStream()
55 
56 #define LOG4CPP_CRIT_S(logger) \
57  if (logger.isCritEnabled()) logger.critStream()
58 
59 #define LOG4CPP_ERROR_S(logger) \
60  if (logger.isErrorEnabled()) logger.errorStream()
61 
62 #define LOG4CPP_WARN_S(logger) \
63  if (logger.isWarnEnabled()) logger.warnStream()
64 
65 #define LOG4CPP_NOTICE_S(logger) \
66  if (logger.isNoticeEnabled()) logger.noticeStream()
67 
68 #define LOG4CPP_INFO_S(logger) \
69  if (logger.isInfoEnabled()) logger.infoStream()
70 
71 #define LOG4CPP_DEBUG_S(logger) \
72  if (logger.isDebugEnabled()) logger.debugStream()
73 
74 
75 // stream logging with default logger "logger"
76 #define LOG4CPP_EMERG_SD() \
77  if (logger.isEmergEnabled()) logger.emergStream()
78 
79 #define LOG4CPP_FATAL_SD() \
80  if (logger.isFatalEnabled()) logger.fatalStream()
81 
82 #define LOG4CPP_ALERT_SD() \
83  if (logger.isAlertEnabled()) logger.alertStream()
84 
85 #define LOG4CPP_CRIT_SD() \
86  if (logger.isCritEnabled()) logger.critStream()
87 
88 #define LOG4CPP_ERROR_SD() \
89  if (logger.isErrorEnabled()) logger.errorStream()
90 
91 #define LOG4CPP_WARN_SD() \
92  if (logger.isWarnEnabled()) logger.warnStream()
93 
94 #define LOG4CPP_NOTICE_SD() \
95  if (logger.isNoticeEnabled()) logger.noticeStream()
96 
97 #define LOG4CPP_INFO_SD() \
98  if (logger.isInfoEnabled()) logger.infoStream()
99 
100 #define LOG4CPP_DEBUG_SD() \
101  if (logger.isDebugEnabled()) logger.debugStream()
102 
103 #endif
104 


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00