Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
#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::Statement |
POD struct representing a logging statement in source code. More... | |
struct | qpid::log::Statement::Initializer |
Namespaces | |
namespace | qpid |
namespace | qpid::log |
Defines | |
#define | QPID_LOG_STATEMENT_INIT(level) { 0, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (::qpid::log::level) } |
#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. | |
#define | QPID_LOG(LEVEL, MESSAGE) QPID_LOG_IF(LEVEL, true, MESSAGE); |
Macro for log statements. | |
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
|
#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());
You can subscribe to log messages by level, by component, by filename or a combination
LEVEL | severity Level for message, should be one of: debug, info, notice, warning, error, critical. NB no qpid::log:: prefix. | |
MESSAGE | any object with an operator<<, or a sequence like of ostreamable objects separated by <<. |
Definition at line 113 of file Statement.h.
#define QPID_LOG_IF | ( | LEVEL, | |||
TEST, | |||||
MESSAGE | ) |
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)
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.
LEVEL | severity Level for message, should be one of: debug, info, notice, warning, error, critical. NB no qpid::log:: prefix. | |
TEST | message is logged only if expression TEST evaluates to true. | |
MESSAGE | any object with an operator<<, or a sequence like of ostreamable objects separated by <<. |
Definition at line 89 of file Statement.h.
#define QPID_LOG_STATEMENT_INIT | ( | level | ) | { 0, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (::qpid::log::level) } |
Definition at line 75 of file Statement.h.