Apache log4cxx  Version 0.12.1
Logging macros

Macros

#define LOG4CXX_UNLIKELY(expr)   expr
 Provides optimization hint to the compiler to optimize for the expression being false. More...
 
#define LOG4CXX_LOG(logger, level, message)
 Logs a message to a specified logger with a specified level. More...
 
#define LOG4CXX_LOG_FMT(logger, level, ...)
 Logs a message to a specified logger with a specified level, formatting utilizing libfmt. More...
 
#define LOG4CXX_LOGLS(logger, level, message)
 Logs a message to a specified logger with a specified level. More...
 
#define LOG4CXX_DEBUG(logger, message)
 Logs a message to a specified logger with the DEBUG level. More...
 
#define LOG4CXX_DEBUG_FMT(logger, ...)
 Logs a message to a specified logger with the DEBUG level, formatting with libfmt. More...
 
#define LOG4CXX_TRACE(logger, message)
 Logs a message to a specified logger with the TRACE level. More...
 
#define LOG4CXX_TRACE_FMT(logger, ...)
 Logs a message to a specified logger with the TRACE level, formatting with libfmt. More...
 
#define LOG4CXX_INFO(logger, message)
 Logs a message to a specified logger with the INFO level. More...
 
#define LOG4CXX_INFO_FMT(logger, ...)
 Logs a message to a specified logger with the INFO level, formatting with libfmt. More...
 
#define LOG4CXX_WARN(logger, message)
 Logs a message to a specified logger with the WARN level. More...
 
#define LOG4CXX_WARN_FMT(logger, ...)
 Logs a message to a specified logger with the WARN level, formatting with libfmt. More...
 
#define LOG4CXX_ERROR(logger, message)
 Logs a message to a specified logger with the ERROR level. More...
 
#define LOG4CXX_ERROR_FMT(logger, ...)
 Logs a message to a specified logger with the ERROR level, formatting with libfmt. More...
 
#define LOG4CXX_ASSERT(logger, condition, message)
 Logs a error if the condition is not true. More...
 
#define LOG4CXX_ASSERT_FMT(logger, condition, ...)
 Logs a error if the condition is not true, formatting with libfmt. More...
 
#define LOG4CXX_FATAL(logger, message)
 Logs a message to a specified logger with the FATAL level. More...
 
#define LOG4CXX_FATAL_FMT(logger, ...)
 Logs a message to a specified logger with the FATAL level, formatting with libfmt. More...
 
#define LOG4CXX_L7DLOG(logger, level, key)
 Logs a localized message with no parameter. More...
 
#define LOG4CXX_L7DLOG1(logger, level, key, p1)
 Logs a localized message with one parameter. More...
 
#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2)
 Logs a localized message with two parameters. More...
 
#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3)
 Logs a localized message with three parameters. More...
 

Detailed Description

Macro Definition Documentation

◆ LOG4CXX_ASSERT

#define LOG4CXX_ASSERT (   logger,
  condition,
  message 
)
Value:
do { \
if (!(condition) && logger->isErrorEnabled()) {\
logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getError()
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552

Logs a error if the condition is not true.

Parameters
loggerthe logger to be used.
conditioncondition
messagethe message string to log.

◆ LOG4CXX_ASSERT_FMT

#define LOG4CXX_ASSERT_FMT (   logger,
  condition,
  ... 
)
Value:
do { \
if (!(condition) && logger->isErrorEnabled()) {\
logger->forcedLog(::log4cxx::Level::getError(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getError()

Logs a error if the condition is not true, formatting with libfmt.

Parameters
loggerthe logger to be used.
conditioncondition
...The format string and message to log

◆ LOG4CXX_DEBUG

#define LOG4CXX_DEBUG (   logger,
  message 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(logger->isDebugEnabled())) {\
logger->forcedLog(::log4cxx::Level::getDebug(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getDebug()
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: logger.h:1756

Logs a message to a specified logger with the DEBUG level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_DEBUG_FMT

#define LOG4CXX_DEBUG_FMT (   logger,
  ... 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(logger->isDebugEnabled())) {\
logger->forcedLog(::log4cxx::Level::getDebug(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getDebug()
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: logger.h:1756

Logs a message to a specified logger with the DEBUG level, formatting with libfmt.

Parameters
loggerthe logger to be used.
...The format string and message to log

◆ LOG4CXX_ERROR

#define LOG4CXX_ERROR (   logger,
  message 
)
Value:
do { \
if (logger->isErrorEnabled()) {\
logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getError()
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552

Logs a message to a specified logger with the ERROR level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_ERROR_FMT

#define LOG4CXX_ERROR_FMT (   logger,
  ... 
)
Value:
do { \
if (logger->isErrorEnabled()) {\
logger->forcedLog(::log4cxx::Level::getError(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getError()

Logs a message to a specified logger with the ERROR level, formatting with libfmt.

Parameters
loggerthe logger to be used.
...The format string and message to log

◆ LOG4CXX_FATAL

#define LOG4CXX_FATAL (   logger,
  message 
)
Value:
do { \
if (logger->isFatalEnabled()) {\
logger->forcedLog(::log4cxx::Level::getFatal(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getFatal()
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552

Logs a message to a specified logger with the FATAL level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_FATAL_FMT

#define LOG4CXX_FATAL_FMT (   logger,
  ... 
)
Value:
do { \
if (logger->isFatalEnabled()) {\
logger->forcedLog(::log4cxx::Level::getFatal(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getFatal()

Logs a message to a specified logger with the FATAL level, formatting with libfmt.

Parameters
loggerthe logger to be used.
...The format string and message to log

◆ LOG4CXX_INFO

#define LOG4CXX_INFO (   logger,
  message 
)
Value:
do { \
if (logger->isInfoEnabled()) {\
logger->forcedLog(::log4cxx::Level::getInfo(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552
static LevelPtr getInfo()

Logs a message to a specified logger with the INFO level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_INFO_FMT

#define LOG4CXX_INFO_FMT (   logger,
  ... 
)
Value:
do { \
if (logger->isInfoEnabled()) {\
logger->forcedLog(::log4cxx::Level::getInfo(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getInfo()

Logs a message to a specified logger with the INFO level, formatting with libfmt.

Parameters
loggerthe logger to be used.
messagethe message string to log.
...The format string and message to log

◆ LOG4CXX_L7DLOG

#define LOG4CXX_L7DLOG (   logger,
  level,
  key 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a localized message with no parameter.

Parameters
loggerthe logger to be used.
levelthe level to log.
keythe key to be searched in the resourceBundle of the logger.

◆ LOG4CXX_L7DLOG1

#define LOG4CXX_L7DLOG1 (   logger,
  level,
  key,
  p1 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a localized message with one parameter.

Parameters
loggerthe logger to be used.
levelthe level to log.
keythe key to be searched in the resourceBundle of the logger.
p1the unique parameter.

◆ LOG4CXX_L7DLOG2

#define LOG4CXX_L7DLOG2 (   logger,
  level,
  key,
  p1,
  p2 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a localized message with two parameters.

Parameters
loggerthe logger to be used.
levelthe level to log.
keythe key to be searched in the resourceBundle of the logger.
p1the first parameter.
p2the second parameter.

◆ LOG4CXX_L7DLOG3

#define LOG4CXX_L7DLOG3 (   logger,
  level,
  key,
  p1,
  p2,
  p3 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a localized message with three parameters.

Parameters
loggerthe logger to be used.
levelthe level to log.
keythe key to be searched in the resourceBundle of the logger.
p1the first parameter.
p2the second parameter.
p3the third parameter.

◆ LOG4CXX_LOG

#define LOG4CXX_LOG (   logger,
  level,
  message 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552

Logs a message to a specified logger with a specified level.

Parameters
loggerthe logger to be used.
levelthe level to log.
messagethe message string to log.

◆ LOG4CXX_LOG_FMT

#define LOG4CXX_LOG_FMT (   logger,
  level,
  ... 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->forcedLog(level, fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a message to a specified logger with a specified level, formatting utilizing libfmt.

Parameters
loggerthe logger to be used.
levelthe level to log.
...The format string and message to log

◆ LOG4CXX_LOGLS

#define LOG4CXX_LOGLS (   logger,
  level,
  message 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
::log4cxx::helpers::LogCharMessageBuffer oss_; \
logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135

Logs a message to a specified logger with a specified level.

Parameters
loggerthe logger to be used.
levelthe level to log.
messagethe message string to log in the internal encoding.

◆ LOG4CXX_TRACE

#define LOG4CXX_TRACE (   logger,
  message 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(logger->isTraceEnabled())) {\
logger->forcedLog(::log4cxx::Level::getTrace(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: logger.h:1756
static LevelPtr getTrace()

Logs a message to a specified logger with the TRACE level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_TRACE_FMT

#define LOG4CXX_TRACE_FMT (   logger,
  ... 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(logger->isTraceEnabled())) {\
logger->forcedLog(::log4cxx::Level::getTrace(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: logger.h:1756
static LevelPtr getTrace()

Logs a message to a specified logger with the TRACE level, formatting with libfmt.

Parameters
loggerthe logger to be used.
...The format string and message to log

◆ LOG4CXX_UNLIKELY

#define LOG4CXX_UNLIKELY (   expr)    expr

Provides optimization hint to the compiler to optimize for the expression being false.

Parameters
exprboolean expression.
Returns
value of expression.

◆ LOG4CXX_WARN

#define LOG4CXX_WARN (   logger,
  message 
)
Value:
do { \
if (logger->isWarnEnabled()) {\
logger->forcedLog(::log4cxx::Level::getWarn(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:552
static LevelPtr getWarn()

Logs a message to a specified logger with the WARN level.

Parameters
loggerthe logger to be used.
messagethe message string to log.

◆ LOG4CXX_WARN_FMT

#define LOG4CXX_WARN_FMT (   logger,
  ... 
)
Value:
do { \
if (logger->isWarnEnabled()) {\
logger->forcedLog(::log4cxx::Level::getWarn(), fmt::format( __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:135
static LevelPtr getWarn()

Logs a message to a specified logger with the WARN level, formatting with libfmt.

Parameters
loggerthe logger to be used.
...The format string and message to log