Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Classes | Namespaces | Macros | Enumerations
Statement.h File Reference
#include "qpid/Msg.h"
#include "qpid/CommonImportExport.h"
#include <boost/current_function.hpp>

Go to the source code of this file.

Classes

struct  qpid::log::LevelTraits
 
struct  qpid::log::CategoryTraits
 
struct  qpid::log::Statement
 POD struct representing a logging statement in source code. More...
 
struct  qpid::log::Statement::Initializer
 

Namespaces

 qpid
 This file was automatically generated from the AMQP specification.
 
 qpid::log
 

Macros

#define QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY)
 
#define QPID_LOG_STATEMENT_INIT(LEVEL)   QPID_LOG_STATEMENT_INIT_CAT ( LEVEL , unspecified )
 
#define QPID_LOG_IF(LEVEL, TEST, MESSAGE)
 Like QPID_LOG but computes an additional boolean test expression to determine if the message should be logged. More...
 
#define QPID_LOG_IF_CAT(LEVEL, CATEGORY, TEST, MESSAGE)
 Line QPID_LOG_IF but with the additional specification of a category. More...
 
#define QPID_LOG_TEST(LEVEL, FLAG)
 FLAG must be a boolean variable. More...
 
#define QPID_LOG_TEST_CAT(LEVEL, CATEGORY, FLAG)
 FLAG must be a boolean variable. More...
 
#define QPID_LOG(LEVEL, MESSAGE)   QPID_LOG_IF(LEVEL, true, MESSAGE);
 Macro for log statements. More...
 
#define QPID_LOG_CAT(LEVEL, CATEGORY, MESSAGE)   QPID_LOG_IF_CAT(LEVEL, CATEGORY, true, MESSAGE);
 Macro for log statements. More...
 

Enumerations

enum  qpid::log::Level {
  qpid::log::trace, qpid::log::debug, qpid::log::info, qpid::log::notice,
  qpid::log::warning, qpid::log::error, qpid::log::critical
}
 Debugging severity levels. More...
 
enum  qpid::log::Category {
  qpid::log::security, qpid::log::broker, qpid::log::management, qpid::log::protocol,
  qpid::log::system, qpid::log::ha, qpid::log::messaging, qpid::log::store,
  qpid::log::network, qpid::log::test, qpid::log::client, qpid::log::model,
  qpid::log::unspecified
}
 Formal message categories https://issues.apache.org/jira/browse/QPID-3902. More...
 

Macro Definition Documentation

#define QPID_LOG (   LEVEL,
  MESSAGE 
)    QPID_LOG_IF(LEVEL, true, MESSAGE);

Macro for log statements.

Example of use:

QPID_LOG(debug, "There are " << foocount << " foos in the bar.");
QPID_LOG(error, boost::format("Dohickey %s exploded") % dohicky.name());

Using QPID_LOG implies a category of Unspecified.

You can subscribe to log messages by level, by component, by filename or a combination

See also
Configuration.
Parameters
LEVELseverity Level for message, should be one of: debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
MESSAGEany object with an operator<<, or a sequence like of ostreamable objects separated by <<.

Definition at line 215 of file Statement.h.

#define QPID_LOG_CAT (   LEVEL,
  CATEGORY,
  MESSAGE 
)    QPID_LOG_IF_CAT(LEVEL, CATEGORY, true, MESSAGE);

Macro for log statements.

Example of use:

QPID_LOG_CAT(debug, System, "There are " << foocount << " foos in the bar.");
QPID_LOG_CAT(error, System, boost::format("Dohickey %s exploded") % dohicky.name());

Using QPID_LOG_CAT requires the specification of a category.

You can subscribe to log messages by level, by component, by filename or a combination

See also
Configuration.
Parameters
LEVELseverity Level for message, should be one of: debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
CATEGORYbasic Category for the message.
MESSAGEany object with an operator<<, or a sequence like of ostreamable objects separated by <<.

Definition at line 234 of file Statement.h.

#define QPID_LOG_IF (   LEVEL,
  TEST,
  MESSAGE 
)
Value:
do { \
using ::qpid::log::Statement; \
static Statement stmt_= QPID_LOG_STATEMENT_INIT(LEVEL); \
static Statement::Initializer init_(stmt_); \
if (stmt_.enabled && (TEST)) \
stmt_.log(::qpid::Msg() << MESSAGE); \
} while(0)
A simple wrapper for std::ostringstream that allows in place construction of a message and automatic ...
Definition: Msg.h:41
#define QPID_LOG_STATEMENT_INIT(LEVEL)
Definition: Statement.h:127

Like QPID_LOG but computes an additional boolean test expression to determine if the message should be logged.

Evaluation of both the test and message expressions occurs only if the requested log level is enabled.

Parameters
LEVELseverity Level for message, should be one of: debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
TESTmessage is logged only if expression TEST evaluates to true.
MESSAGEany object with an operator<<, or a sequence like of ostreamable objects separated by <<.

Definition at line 141 of file Statement.h.

#define QPID_LOG_IF_CAT (   LEVEL,
  CATEGORY,
  TEST,
  MESSAGE 
)
Value:
do { \
using ::qpid::log::Statement; \
static Statement stmt_= QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY); \
static Statement::Initializer init_(stmt_); \
if (stmt_.enabled && (TEST)) \
stmt_.log(::qpid::Msg() << MESSAGE); \
} while(0)
A simple wrapper for std::ostringstream that allows in place construction of a message and automatic ...
Definition: Msg.h:41
#define QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY)
Definition: Statement.h:121

Line QPID_LOG_IF but with the additional specification of a category.

Parameters
CATEGORYmessage category.

Definition at line 154 of file Statement.h.

#define QPID_LOG_STATEMENT_INIT (   LEVEL)    QPID_LOG_STATEMENT_INIT_CAT ( LEVEL , unspecified )

Definition at line 127 of file Statement.h.

#define QPID_LOG_STATEMENT_INIT_CAT (   LEVEL,
  CATEGORY 
)
Value:
{ 0, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (::qpid::log::LEVEL), \
(::qpid::log::CATEGORY) }

Definition at line 121 of file Statement.h.

#define QPID_LOG_TEST (   LEVEL,
  FLAG 
)
Value:
do { \
using ::qpid::log::Statement; \
static Statement stmt_= QPID_LOG_STATEMENT_INIT(LEVEL); \
static Statement::Initializer init_(stmt_); \
FLAG = stmt_.enabled; \
} while(0)
#define QPID_LOG_STATEMENT_INIT(LEVEL)
Definition: Statement.h:127

FLAG must be a boolean variable.

Assigns FLAG to true iff logging is enabled for LEVEL in the calling context. Use when extra support code is needed to generate log messages, to ensure that it is only run if the logging level is enabled. e.g. bool logWarning; QPID_LOG_TEST(warning, logWarning); if (logWarning) { do stuff needed for warning log messages }

Definition at line 173 of file Statement.h.

#define QPID_LOG_TEST_CAT (   LEVEL,
  CATEGORY,
  FLAG 
)
Value:
do { \
using ::qpid::log::Statement; \
static Statement stmt_= QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY); \
static Statement::Initializer init_(stmt_); \
FLAG = stmt_.enabled; \
} while(0)
#define QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY)
Definition: Statement.h:121

FLAG must be a boolean variable.

Assigns FLAG to true iff logging is enabled for LEVEL in the calling context. Use when extra support code is needed to generate log messages, to ensure that it is only run if the logging level is enabled. e.g. bool logWarning; QPID_LOG_TEST_CAT(warning, System, logWarning); if (logWarning) { do stuff needed for warning log messages }

Definition at line 191 of file Statement.h.


Qpid C++ API Reference
Generated on Thu Sep 4 2014 for Qpid C++ Client API by doxygen 1.8.7