diff options
| author | Alan Conway <aconway@apache.org> | 2011-08-31 19:49:04 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-08-31 19:49:04 +0000 |
| commit | 014014cbc000c43164460881f810b9c06662bb2a (patch) | |
| tree | 7d9df9e2210a71785b318a0ef049a809c7fe61e4 /cpp/src/qpid/cluster/Cluster.cpp | |
| parent | 0c711fd766892ff72a597bdb258ac77d40274aa0 (diff) | |
| download | qpid-python-014014cbc000c43164460881f810b9c06662bb2a.tar.gz | |
NO-JIRA: Suppress logging of clock events in cluster code.
Clock events are much too frequent to log, doing so makes trace
logging useless for clustered brokers.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1163766 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index 1c398d63f4..7432fbbc33 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -526,7 +526,7 @@ void Cluster::deliveredFrame(const EventFrame& efConst) { void Cluster::processFrame(const EventFrame& e, Lock& l) { if (e.isCluster()) { - QPID_LOG(trace, *this << " DLVR: " << e); + QPID_LOG_IF(trace, loggable(e.frame), *this << " DLVR: " << e); ClusterDispatcher dispatch(*this, e.connectionId.getMember(), l); if (!framing::invoke(dispatch, *e.frame.getBody()).wasHandled()) throw Exception(QPID_MSG("Invalid cluster control")); @@ -535,14 +535,15 @@ void Cluster::processFrame(const EventFrame& e, Lock& l) { map.incrementFrameSeq(); ConnectionPtr connection = getConnection(e, l); if (connection) { - QPID_LOG(trace, *this << " DLVR " << map.getFrameSeq() << ": " << e); + QPID_LOG_IF(trace, loggable(e.frame), + *this << " DLVR " << map.getFrameSeq() << ": " << e); connection->deliveredFrame(e); } else throw Exception(QPID_MSG("Unknown connection: " << e)); } else // Drop connection frames while state < CATCHUP - QPID_LOG(trace, *this << " DROP (joining): " << e); + QPID_LOG_IF(trace, loggable(e.frame), *this << " DROP (joining): " << e); } // Called in deliverFrameQueue thread @@ -1219,4 +1220,12 @@ bool Cluster::deferDeliveryImpl(const std::string& queue, return true; } +bool Cluster::loggable(const AMQFrame& f) { + const AMQMethodBody* method = (f.getMethod()); + if (!method) return true; // Not a method + bool isClock = method->amqpClassId() == ClusterClockBody::CLASS_ID + && method->amqpMethodId() == ClusterClockBody::METHOD_ID; + return !isClock; +} + }} // namespace qpid::cluster |
