- Main Page
- Modules
- Namespaces
- Classes
- Files

# Logging macros

## Defines

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

## Define Documentation

#define LOG4CXX_ASSERT | ( | logger,
|  | condition,
|  | message |  | ) |

| Value:
    { \
            if (!(condition) && logger->isErrorEnabled()) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a error if the condition is not true.

Parameters:

  | logger | the logger to be used.
  | condition | condition
  | message | the message string to log.

#define LOG4CXX_DEBUG | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (LOG4CXX_UNLIKELY(logger->isDebugEnabled())) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getDebug(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the DEBUG level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.

#define LOG4CXX_ERROR | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (logger->isErrorEnabled()) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the ERROR level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.

#define LOG4CXX_FATAL | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (logger->isFatalEnabled()) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getFatal(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the FATAL level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.

#define LOG4CXX_INFO | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (logger->isInfoEnabled()) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getInfo(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the INFO level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.

#define LOG4CXX_L7DLOG | ( | logger,
|  | level,
|  | key |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
            logger->l7dlog(level, key, LOG4CXX_LOCATION); }}
Logs a localized message with no parameter.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | key | the key to be searched in the resourceBundle of the logger.

#define LOG4CXX_L7DLOG1 | ( | logger,
|  | level,
|  | key,
|  | p1 |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
            logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }}
Logs a localized message with one parameter.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | key | the key to be searched in the resourceBundle of the logger.
  | p1 | the unique parameter.

#define LOG4CXX_L7DLOG2 | ( | logger,
|  | level,
|  | key,
|  | p1,
|  | p2 |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
            logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }}
Logs a localized message with two parameters.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | key | the key to be searched in the resourceBundle of the logger.
  | p1 | the first parameter.
  | p2 | the second parameter.

#define LOG4CXX_L7DLOG3 | ( | logger,
|  | level,
|  | key,
|  | p1,
|  | p2,
|  | p3 |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
            logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }}
Logs a localized message with three parameters.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | key | the key to be searched in the resourceBundle of the logger.
  | p1 | the first parameter.
  | p2 | the second parameter.
  | p3 | the third parameter.

#define LOG4CXX_LOG | ( | logger,
|  | level,
|  | message |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); } }
Logs a message to a specified logger with a specified level.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | message | the message string to log.

#define LOG4CXX_LOGLS | ( | logger,
|  | level,
|  | message |  | ) |

| Value:
    { \
            if (logger->isEnabledFor(level)) {\
               ::log4cxx::helpers::LogCharMessageBuffer oss_; \
               logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); } }
Logs a message to a specified logger with a specified level.

Parameters:

  | logger | the logger to be used.
  | level | the level to log.
  | message | the message string to log in the internal encoding.

#define LOG4CXX_TRACE | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (LOG4CXX_UNLIKELY(logger->isTraceEnabled())) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getTrace(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the TRACE level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.

#define LOG4CXX_UNLIKELY | ( | expr |  | ) | expr

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

Parameters:

  | expr | boolean expression.

Returns:
  value of expression.

#define LOG4CXX_WARN | ( | logger,
|  | message |  | ) |

| Value:
    { \
            if (logger->isWarnEnabled()) {\
               ::log4cxx::helpers::MessageBuffer oss_; \
               logger->forcedLog(::log4cxx::Level::getWarn(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }}
Logs a message to a specified logger with the WARN level.

Parameters:

  | logger | the logger to be used.
  | message | the message string to log.