log4cpp 1.1.6
Loading...
Searching...
No Matches
LogMacros.hh File Reference

Optional macro wrappers for loggers, include formatted and streaming style. More...

#include <log4cpp/Category.hh>
#include <sstream>

Go to the source code of this file.

Macros

#define LOG4CPP_PRIORITY_EMERG   0
#define LOG4CPP_PRIORITY_FATAL   0
#define LOG4CPP_PRIORITY_ALERT   100
#define LOG4CPP_PRIORITY_CRIT   200
#define LOG4CPP_PRIORITY_ERROR   300
#define LOG4CPP_PRIORITY_WARN   400
#define LOG4CPP_PRIORITY_NOTICE   500
#define LOG4CPP_PRIORITY_INFO   600
#define LOG4CPP_PRIORITY_DEBUG   700
#define LOG4CPP_PRIORITY_NOTSET   800
#define LOG4CPP_VARIADIC_MACROS_SUPPORTED   0
#define LOG4CPP_LOG_NO_VA(logger, priority, msg)
#define LOG4CPP_DEBUG(logger, msg)
#define LOG4CPP_INFO(logger, msg)
#define LOG4CPP_NOTICE(logger, msg)
#define LOG4CPP_WARN(logger, msg)
#define LOG4CPP_ERROR(logger, msg)
#define LOG4CPP_CRIT(logger, msg)
#define LOG4CPP_ALERT(logger, msg)
#define LOG4CPP_FATAL(logger, msg)
#define LOG4CPP_EMERG(logger, msg)
#define LOG4CPP_STREAM(logger, priority, streamSequence)
#define LOG4CPP_DEBUG_S(logger, streamSequence)
#define LOG4CPP_INFO_S(logger, streamSequence)
#define LOG4CPP_NOTICE_S(logger, streamSequence)
#define LOG4CPP_WARN_S(logger, streamSequence)
#define LOG4CPP_ERROR_S(logger, streamSequence)
#define LOG4CPP_CRIT_S(logger, streamSequence)
#define LOG4CPP_ALERT_S(logger, streamSequence)
#define LOG4CPP_FATAL_S(logger, streamSequence)
#define LOG4CPP_EMERG_S(logger, streamSequence)

Detailed Description

Optional macro wrappers for loggers, include formatted and streaming style.

Define LOG4CPP_ACTIVE_LEVEL as one of the LOG4CPP_PRIORITY_* macros for compile-time stripping of lower-priority logging calls. The #define directive must precede the inclusion of this header file. All log macros with priority level lower than value of LOG4CPP_ACTIVE_LEVEL will be removed at compile time resulting in zero runtime overhead.

Formatting macros are not available on older compilers that lack variadic macro support. In such cases, only macros accepting static messages are defined.

Macro Definition Documentation

◆ LOG4CPP_ALERT

#define LOG4CPP_ALERT ( logger,
msg )
Value:
#define LOG4CPP_LOG_NO_VA(logger, priority, msg)
Definition LogMacros.hh:242
@ ALERT
Definition Priority.hh:72

◆ LOG4CPP_ALERT_S

#define LOG4CPP_ALERT_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::ALERT, streamSequence)
#define LOG4CPP_STREAM(logger, priority, streamSequence)
Definition LogMacros.hh:307

◆ LOG4CPP_CRIT

#define LOG4CPP_CRIT ( logger,
msg )
Value:
@ CRIT
Definition Priority.hh:73

◆ LOG4CPP_CRIT_S

#define LOG4CPP_CRIT_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::CRIT, streamSequence)

◆ LOG4CPP_DEBUG

#define LOG4CPP_DEBUG ( logger,
msg )
Value:
@ DEBUG
Definition Priority.hh:78

◆ LOG4CPP_DEBUG_S

#define LOG4CPP_DEBUG_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::DEBUG, streamSequence)

◆ LOG4CPP_EMERG

#define LOG4CPP_EMERG ( logger,
msg )
Value:
@ EMERG
Definition Priority.hh:70

◆ LOG4CPP_EMERG_S

#define LOG4CPP_EMERG_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::EMERG, streamSequence)

◆ LOG4CPP_ERROR

#define LOG4CPP_ERROR ( logger,
msg )
Value:
@ ERROR
Definition Priority.hh:74

◆ LOG4CPP_ERROR_S

#define LOG4CPP_ERROR_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::ERROR, streamSequence)

◆ LOG4CPP_FATAL

#define LOG4CPP_FATAL ( logger,
msg )
Value:
@ FATAL
Definition Priority.hh:71

◆ LOG4CPP_FATAL_S

#define LOG4CPP_FATAL_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::FATAL, streamSequence)

◆ LOG4CPP_INFO

#define LOG4CPP_INFO ( logger,
msg )
Value:
@ INFO
Definition Priority.hh:77

◆ LOG4CPP_INFO_S

#define LOG4CPP_INFO_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::INFO, streamSequence)

◆ LOG4CPP_LOG_NO_VA

#define LOG4CPP_LOG_NO_VA ( logger,
priority,
msg )
Value:
do { \
if ((logger).isPriorityEnabled(priority)) { \
(logger).log(priority, msg); \
} \
} while (0)

◆ LOG4CPP_NOTICE

#define LOG4CPP_NOTICE ( logger,
msg )
Value:
@ NOTICE
Definition Priority.hh:76

◆ LOG4CPP_NOTICE_S

#define LOG4CPP_NOTICE_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::NOTICE, streamSequence)

◆ LOG4CPP_PRIORITY_ALERT

#define LOG4CPP_PRIORITY_ALERT   100

◆ LOG4CPP_PRIORITY_CRIT

#define LOG4CPP_PRIORITY_CRIT   200

◆ LOG4CPP_PRIORITY_DEBUG

#define LOG4CPP_PRIORITY_DEBUG   700

◆ LOG4CPP_PRIORITY_EMERG

#define LOG4CPP_PRIORITY_EMERG   0

◆ LOG4CPP_PRIORITY_ERROR

#define LOG4CPP_PRIORITY_ERROR   300

◆ LOG4CPP_PRIORITY_FATAL

#define LOG4CPP_PRIORITY_FATAL   0

◆ LOG4CPP_PRIORITY_INFO

#define LOG4CPP_PRIORITY_INFO   600

◆ LOG4CPP_PRIORITY_NOTICE

#define LOG4CPP_PRIORITY_NOTICE   500

◆ LOG4CPP_PRIORITY_NOTSET

#define LOG4CPP_PRIORITY_NOTSET   800

◆ LOG4CPP_PRIORITY_WARN

#define LOG4CPP_PRIORITY_WARN   400

◆ LOG4CPP_STREAM

#define LOG4CPP_STREAM ( logger,
priority,
streamSequence )
Value:
do { \
if ((logger).isPriorityEnabled(priority)) { \
(logger).getStream(priority) << streamSequence; \
} \
} while (0)

◆ LOG4CPP_VARIADIC_MACROS_SUPPORTED

#define LOG4CPP_VARIADIC_MACROS_SUPPORTED   0

◆ LOG4CPP_WARN

#define LOG4CPP_WARN ( logger,
msg )
Value:
@ WARN
Definition Priority.hh:75

◆ LOG4CPP_WARN_S

#define LOG4CPP_WARN_S ( logger,
streamSequence )
Value:
LOG4CPP_STREAM(logger, log4cpp::Priority::WARN, streamSequence)