Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
Logging macros

Macros

#define LOG4CXX_UNLIKELY(expr)   expr
 Provides optimization hint to the compiler to optimize for the expression being false.
 
#define LOG4CXX_STACKTRACE
 
#define LOG4CXX_LOG(logger, level, message)
 Add a new logging event containing message to attached appender(s) if this logger is enabled for events.
 
#define LOG4CXX_LOG_FMT(logger, level, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if this logger is enabled for events.
 
#define LOG4CXX_LOGLS(logger, level, message)
 Add a new logging event containing message to attached appender(s) if this logger is enabled for events.
 
#define LOG4CXX_DEBUG(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for DEBUG events.
 
#define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for DEBUG events.
 
#define LOG4CXX_TRACE(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for TRACE events.
 
#define LOG4CXX_TRACE_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for TRACE events.
 
#define LOG4CXX_INFO(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for INFO events.
 
#define LOG4CXX_INFO_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for INFO events.
 
#define LOG4CXX_WARN(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for WARN events.
 
#define LOG4CXX_WARN_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for WARN events.
 
#define LOG4CXX_ERROR(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for ERROR events.
 
#define LOG4CXX_ERROR_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for ERROR events.
 
#define LOG4CXX_ASSERT(logger, condition, message)
 If condition is not true, add a new logging event containing message to attached appender(s) if logger is enabled for ERROR events.
 
#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
 If condition is not true, add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for ERROR events.
 
#define LOG4CXX_FATAL(logger, message)
 Add a new logging event containing message to attached appender(s) if logger is enabled for FATAL events.
 
#define LOG4CXX_FATAL_FMT(logger, fmt, ...)
 Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for FATAL events.
 
#define LOG4CXX_L7DLOG(logger, level, key)
 Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events.
 
#define LOG4CXX_L7DLOG1(logger, level, key, p1)
 Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with one parameter.
 
#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2)
 Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with two parameters.
 
#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3)
 Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with three parameters.
 

Detailed Description

Macro Definition Documentation

◆ LOG4CXX_ASSERT

#define LOG4CXX_ASSERT (   logger,
  condition,
  message 
)
Value:
do { \
if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
LOG4CXX_STACKTRACE \
logger->addEvent(::LOG4CXX_NS::Level::getError(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:170

If condition is not true, add a new logging event containing message to attached appender(s) if logger is enabled for ERROR events.

Parameters
loggerthe logger to be used.
conditioncondition
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.

◆ LOG4CXX_ASSERT_FMT

#define LOG4CXX_ASSERT_FMT (   logger,
  condition,
  fmt,
  ... 
)
Value:
do { \
if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
LOG4CXX_STACKTRACE \
logger->addEvent(::LOG4CXX_NS::Level::getError(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

If condition is not true, add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for ERROR events.

Parameters
loggerthe logger to be used.
conditioncondition
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_DEBUG

#define LOG4CXX_DEBUG (   logger,
  message 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getDebug(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: log4cxx/logger.h:1995

Add a new logging event containing message to attached appender(s) if logger is enabled for DEBUG events.

Example usage:
LOG4CXX_DEBUG(m_log, "AddMesh:"
<< " name " << meshName
<< " type 0x" << std:: hex << traits.Type
<< " materialName " << meshObject.GetMaterialName()
<< " visible? " << traits.IsDefaultVisible
<< " at " << obj->getBoundingBox().getCenter()
<< " +/- " << obj->getBoundingBox().getHalfSize()
);
#define LOG4CXX_DEBUG(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for DEBUG eve...
Definition: log4cxx/logger.h:2075
Parameters
loggerthe logger that has the enabled status.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.
Examples
auto-configured.cpp, and ndc-example.cpp.

◆ LOG4CXX_DEBUG_FMT

#define LOG4CXX_DEBUG_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
logger->addEvent(::LOG4CXX_NS::Level::getDebug(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for DEBUG events.

Example usage:
LOG4CXX_DEBUG_FMT(m_log, "AddMesh: name {} type 0x{x} materialName {} visible? {d} at {} +/- {}"
, meshName
, traits.Type
, meshObject.GetMaterialName()
, traits.IsDefaultVisible
, obj->getBoundingBox().getCenter()
, obj->getBoundingBox().getHalfSize()
);
#define LOG4CXX_DEBUG_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2099
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_ERROR

#define LOG4CXX_ERROR (   logger,
  message 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getError(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if logger is enabled for ERROR events.

Example usage:
catch (std::exception& ex)
{
LOG4CXX_ERROR(m_log, ex.what() << " in AddScanData");
}
#define LOG4CXX_ERROR(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for ERROR eve...
Definition: log4cxx/logger.h:2248
Parameters
loggerthe logger to be used.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.

◆ LOG4CXX_ERROR_FMT

#define LOG4CXX_ERROR_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
logger->addEvent(::LOG4CXX_NS::Level::getError(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for ERROR events.

Example usage:
catch (std::exception& ex)
{
LOG4CXX_ERROR_FMT(m_log, "{} in AddScanData", ex.what());
}
#define LOG4CXX_ERROR_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2268
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_FATAL

#define LOG4CXX_FATAL (   logger,
  message 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getFatal(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if logger is enabled for FATAL events.

Example usage:
LOG4CXX_FATAL(m_log, m_renderSystem->getName() << " is not supported");
#define LOG4CXX_FATAL(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for FATAL eve...
Definition: log4cxx/logger.h:2319
Parameters
loggerthe logger to be used.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.

◆ LOG4CXX_FATAL_FMT

#define LOG4CXX_FATAL_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
logger->addEvent(::LOG4CXX_NS::Level::getFatal(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for FATAL events.

Example usage:
LOG4CXX_FATAL_FMT(m_log, "{} is not supported", m_renderSystem->getName());
#define LOG4CXX_FATAL_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2336
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_INFO

#define LOG4CXX_INFO (   logger,
  message 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getInfo(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if logger is enabled for INFO events.

Example usage:
LOG4CXX_INFO(m_log, surface->GetName()
<< " successfully planned " << std::fixed << std::setprecision(1) << ((plannedArea / (plannedArea + unplannedArea)) * 100.0) << "%"
<< " planned area " << std::fixed << std::setprecision(4) << plannedArea << "m^2"
<< " unplanned area " << unplannedArea << "m^2"
<< " planned segments " << surface->GetSegmentPlanCount() << " of " << surface->GetSegmentCount()
);
#define LOG4CXX_INFO(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for INFO even...
Definition: log4cxx/logger.h:2161
Parameters
loggerthe logger that has the enabled status.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.
Examples
MyApp-qt.cpp, auto-configured.cpp, custom-appender.cpp, format-string.cpp, and ndc-example.cpp.

◆ LOG4CXX_INFO_FMT

#define LOG4CXX_INFO_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
logger->addEvent(::LOG4CXX_NS::Level::getInfo(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for INFO events.

Example usage:
LOG4CXX_INFO_FMT(m_log, "{} successfully planned {:.1f}% planned area {:.4f}m^2 unplanned area {:.4f}m^2 planned segments {:d} of {:d}"
, surface->GetName(), (plannedArea / (plannedArea + unplannedArea)) * 100.0
, plannedArea, unplannedArea
, surface->GetSegmentPlanCount(), surface->GetSegmentCount()
);
#define LOG4CXX_INFO_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2182
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.
Examples
format-string.cpp.

◆ LOG4CXX_L7DLOG

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

Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events.

Parameters
loggerthe logger to be used.
levelThe logging event level.
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)

Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with one parameter.

Parameters
loggerthe logger to be used.
levelThe logging event level.
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)

Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with two parameters.

Parameters
loggerthe logger to be used.
levelThe logging event level.
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)

Add a new logging event containing the localized message key to attached appender(s) if logger is enabled for level events with three parameters.

Parameters
loggerthe logger to be used.
levelThe logging event level.
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)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if this logger is enabled for events.

Parameters
loggerthe logger to be used.
levelThe logging event level.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.

◆ LOG4CXX_LOG_FMT

#define LOG4CXX_LOG_FMT (   logger,
  level,
  fmt,
  ... 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if this logger is enabled for events.

Parameters
loggerthe logger to be used.
levelThe logging event level.
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_LOGLS

#define LOG4CXX_LOGLS (   logger,
  level,
  message 
)
Value:
do { \
if (logger->isEnabledFor(level)) {\
::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if this logger is enabled for events.

Parameters
loggerthe logger to be used.
levelThe logging event level.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload. in the internal encoding.

◆ LOG4CXX_STACKTRACE

#define LOG4CXX_STACKTRACE

◆ LOG4CXX_TRACE

#define LOG4CXX_TRACE (   logger,
  message 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getTrace(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if logger is enabled for TRACE events.

Example usage:
LOG4CXX_TRACE(m_log, "AddVertex:" << " at " << p << " n " << n << ' ' << color);
#define LOG4CXX_TRACE(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for TRACE eve...
Definition: log4cxx/logger.h:2119
Parameters
loggerthe logger that has the enabled status.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.

◆ LOG4CXX_TRACE_FMT

#define LOG4CXX_TRACE_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
logger->addEvent(::LOG4CXX_NS::Level::getTrace(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for TRACE events.

Example usage:
LOG4CXX_TRACE_FMT(m_log, "AddVertex: at {} n {} {}", p, n, color);
#define LOG4CXX_TRACE_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2136
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.

◆ 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 (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addEvent(::LOG4CXX_NS::Level::getWarn(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing message to attached appender(s) if logger is enabled for WARN events.

Example usage:
catch (const std::exception& ex)
{
LOG4CXX_WARN(m_log, ex.what() << ": in " << m_task->GetParamFilePath());
}
#define LOG4CXX_WARN(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for WARN even...
Definition: log4cxx/logger.h:2205
Parameters
loggerthe logger to be used.
messagea valid r-value expression of an operator<<(std::ostream&. ...) overload.
Examples
ndc-example.cpp.

◆ LOG4CXX_WARN_FMT

#define LOG4CXX_WARN_FMT (   logger,
  fmt,
  ... 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
logger->addEvent(::LOG4CXX_NS::Level::getWarn(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)

Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger is enabled for WARN events.

Example usage:
catch (const std::exception& ex)
{
LOG4CXX_WARN_FMT(m_log, "{}: in {}", ex.what(), m_task->GetParamFilePath());
}
#define LOG4CXX_WARN_FMT(logger, fmt,...)
Add a new logging event containing a message defined by fmt and ... to attached appender(s) if logger...
Definition: log4cxx/logger.h:2225
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.