summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/management
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-05 18:02:32 +0000
committerAlan Conway <aconway@apache.org>2010-03-05 18:02:32 +0000
commit952a527bd4e422de485154da9d38046629ea06b3 (patch)
treead5ea8ae851b52ade042ac627c7dce0a9bd85d53 /cpp/src/qpid/management
parentc1b2598e8b48f54a38d0b4dfb5ffa705b65349af (diff)
downloadqpid-python-952a527bd4e422de485154da9d38046629ea06b3.tar.gz
Don't generate debug snapshot messages unless debug logging enabled.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@919523 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/management')
-rw-r--r--cpp/src/qpid/management/ManagementAgent.cpp10
-rw-r--r--cpp/src/qpid/management/ManagementAgent.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp
index 6263651a98..e4a3bd343f 100644
--- a/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/cpp/src/qpid/management/ManagementAgent.cpp
@@ -295,7 +295,7 @@ void ManagementAgent::clusterUpdate() {
// Set clientWasAdded so that on the next periodicProcessing we will do
// a full update on all cluster members.
clientWasAdded = true;
- debugSnapshot("update");
+ QPID_LOG(debug, "cluster update " << debugSnapshot());
}
void ManagementAgent::encodeHeader (Buffer& buf, uint8_t opcode, uint32_t seq)
@@ -525,7 +525,7 @@ void ManagementAgent::periodicProcessing (void)
sendBuffer (msgBuffer, contentSize, mExchange, routingKey);
QPID_LOG(trace, "SEND HeartbeatInd to=" << routingKey);
}
- debugSnapshot("periodic");
+ QPID_LOG(debug, "periodic update " << debugSnapshot());
}
void ManagementAgent::deleteObjectNowLH(const ObjectId& oid)
@@ -1506,14 +1506,14 @@ void ManagementAgent::importAgents(qpid::framing::Buffer& inBuf) {
}
}
-void ManagementAgent::debugSnapshot(const char* type) {
+std::string ManagementAgent::debugSnapshot() {
std::ostringstream msg;
- msg << type << " snapshot, agents:";
+ msg << " management snapshot:";
for (RemoteAgentMap::const_iterator i=remoteAgents.begin();
i != remoteAgents.end(); ++i)
msg << " " << i->second->routingKey;
msg << " packages: " << packages.size();
msg << " objects: " << managementObjects.size();
msg << " new objects: " << newManagementObjects.size();
- QPID_LOG(trace, msg.str());
+ return msg.str();
}
diff --git a/cpp/src/qpid/management/ManagementAgent.h b/cpp/src/qpid/management/ManagementAgent.h
index 3e00ebeb81..cea6cc66bc 100644
--- a/cpp/src/qpid/management/ManagementAgent.h
+++ b/cpp/src/qpid/management/ManagementAgent.h
@@ -306,7 +306,7 @@ private:
size_t validateTableSchema(framing::Buffer&);
size_t validateEventSchema(framing::Buffer&);
ManagementObjectMap::iterator numericFind(const ObjectId& oid);
- void debugSnapshot(const char*);
+ std::string debugSnapshot();
};
}}