summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/log
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/log')
-rw-r--r--cpp/src/qpid/log/Logger.cpp6
-rw-r--r--cpp/src/qpid/log/Logger.h5
-rw-r--r--cpp/src/qpid/log/Statement.cpp4
-rw-r--r--cpp/src/qpid/log/Statement.h24
4 files changed, 4 insertions, 35 deletions
diff --git a/cpp/src/qpid/log/Logger.cpp b/cpp/src/qpid/log/Logger.cpp
index 6e8f3a59cc..c483ed2379 100644
--- a/cpp/src/qpid/log/Logger.cpp
+++ b/cpp/src/qpid/log/Logger.cpp
@@ -190,12 +190,6 @@ void Logger::add(Statement& s) {
statements.insert(&s);
}
-void Logger::remove(Statement& s) {
- ScopedLock l(lock);
- s.enabled = false;
- statements.erase(&s);
-}
-
void Logger::configure(const Options& opts, const std::string& prog)
{
clear();
diff --git a/cpp/src/qpid/log/Logger.h b/cpp/src/qpid/log/Logger.h
index a2103f5ec6..7851c65406 100644
--- a/cpp/src/qpid/log/Logger.h
+++ b/cpp/src/qpid/log/Logger.h
@@ -67,9 +67,6 @@ class Logger : private boost::noncopyable {
/** Add a statement. */
void add(Statement& s);
- /** Remove a statement */
- void remove(Statement& s);
-
/** Log a message. */
void log(const Statement&, const std::string&);
@@ -93,7 +90,7 @@ class Logger : private boost::noncopyable {
/** Add an output destination for messages */
void output(std::auto_ptr<Output> out);
- /** Reset the logger to it's original state */
+ /** Reset the logger to it's original state. */
void clear();
private:
diff --git a/cpp/src/qpid/log/Statement.cpp b/cpp/src/qpid/log/Statement.cpp
index 9ab314b81c..de130bc455 100644
--- a/cpp/src/qpid/log/Statement.cpp
+++ b/cpp/src/qpid/log/Statement.cpp
@@ -32,10 +32,6 @@ Statement::Initializer::Initializer(Statement& s) : statement(s) {
Logger::instance().add(s);
}
-Statement::Initializer::~Initializer() {
- Logger::instance().remove(statement);
-}
-
namespace {
const char* names[LevelTraits::COUNT] = {
"trace", "debug", "info", "notice", "warning", "error", "critical"
diff --git a/cpp/src/qpid/log/Statement.h b/cpp/src/qpid/log/Statement.h
index 4eb4d1e7d8..18162971b0 100644
--- a/cpp/src/qpid/log/Statement.h
+++ b/cpp/src/qpid/log/Statement.h
@@ -19,8 +19,9 @@
*
*/
+#include "qpid/Msg.h"
+
#include <boost/current_function.hpp>
-#include <sstream>
namespace qpid {
namespace log {
@@ -69,23 +70,14 @@ struct Statement {
struct Initializer {
Initializer(Statement& s);
- ~Initializer();
Statement& statement;
};
};
-///@internal trickery to make QPID_LOG_STRINGSTREAM work.
-inline std::ostream& noop(std::ostream& s) { return s; }
-
///@internal static initializer for a Statement.
#define QPID_LOG_STATEMENT_INIT(level) \
{ 0, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (::qpid::log::level) }
-///@internal Stream streamable message and return a string.
-#define QPID_LOG_STRINGSTREAM(message) \
- static_cast<std::ostringstream&>( \
- std::ostringstream() << qpid::log::noop << message).str()
-
/**
* Macro for log statements. Example of use:
* @code
@@ -110,19 +102,9 @@ inline std::ostream& noop(std::ostream& s) { return s; }
static ::qpid::log::Statement stmt_= QPID_LOG_STATEMENT_INIT(level); \
static ::qpid::log::Statement::Initializer init_(stmt_); \
if (stmt_.enabled) \
- stmt_.log(QPID_LOG_STRINGSTREAM(message)); \
+ stmt_.log(::qpid::Msg() << message); \
} while(0)
-/**
- * Macro for complicated logging logic that can't fit in a simple QPID_LOG
- * statement. For example:
- * @code
- * QPID_IF_LOG(debug) {
- * message = do_complicated_stuff;
- * QPID_LOG(debug, message);
- * }
- */
-#define QPID_IF_LOG(level)
}} // namespace qpid::log