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

Macros

#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->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_LOCATION
Definition: locationinfo.h:171

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->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
#define LOG4CXX_FMT_VA_ARG(...)
Definition: log4cxx/logger.h:2157

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->addDebugEvent(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:2130

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:2221
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->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2245
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->addErrorEvent(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:2394
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->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2414
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->addFatalEvent(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:2465
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->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2482
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->addInfoEvent(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:2307
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->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2328
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 LOG4CXX_FMT_VA_ARG(__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_TRACE

#define LOG4CXX_TRACE (   logger,
  message 
)
Value:
do { \
if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addTraceEvent(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:2265
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->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2282
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.

◆ LOG4CXX_WARN

#define LOG4CXX_WARN (   logger,
  message 
)
Value:
do { \
if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
::LOG4CXX_NS::helpers::MessageBuffer oss_; \
logger->addWarnEvent(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:2351
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->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__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:2371
Parameters
loggerthe logger to be used.
fmtthe layout of the message.
...the variable parts of the message.