summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/log
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-11-12 17:15:20 +0000
committerAlan Conway <aconway@apache.org>2008-11-12 17:15:20 +0000
commitc99d4d45ead8020517838b99e2106887701b17d7 (patch)
tree66559a3df444de8a4cb52ffbead0123dd2325d69 /cpp/src/qpid/log
parent1a18c1798833e7201177e786afa0d05412c4f53b (diff)
downloadqpid-python-c99d4d45ead8020517838b99e2106887701b17d7.tar.gz
Cluster replicates queues/exchanges with same encode/decode functions as the store.
Removed un-necessary heap allocation in QPID_LOG statements. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713425 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/log')
-rw-r--r--cpp/src/qpid/log/Selector.cpp5
-rw-r--r--cpp/src/qpid/log/Selector.h2
-rw-r--r--cpp/src/qpid/log/Statement.h4
3 files changed, 4 insertions, 7 deletions
diff --git a/cpp/src/qpid/log/Selector.cpp b/cpp/src/qpid/log/Selector.cpp
index 994421d0ff..4d1c5b6e0c 100644
--- a/cpp/src/qpid/log/Selector.cpp
+++ b/cpp/src/qpid/log/Selector.cpp
@@ -52,12 +52,13 @@ Selector::Selector(const Options& opt){
boost::bind(&Selector::enable, this, _1));
}
-bool Selector::isEnabled(Level level, const std::string& function) {
+bool Selector::isEnabled(Level level, const char* function) {
+ const char* functionEnd = function+::strlen(function);
for (std::vector<std::string>::iterator i=substrings[level].begin();
i != substrings[level].end();
++i)
{
- if (function.find(*i) != std::string::npos)
+ if (std::search(function, functionEnd, i->begin(), i->end()) != functionEnd)
return true;
}
return false;
diff --git a/cpp/src/qpid/log/Selector.h b/cpp/src/qpid/log/Selector.h
index 89989ebf92..705abfeb5d 100644
--- a/cpp/src/qpid/log/Selector.h
+++ b/cpp/src/qpid/log/Selector.h
@@ -57,7 +57,7 @@ class Selector {
void enable(const std::string& enableStr);
/** True if level is enabled for file. */
- bool isEnabled(Level level, const std::string& function);
+ bool isEnabled(Level level, const char* function);
private:
std::vector<std::string> substrings[LevelTraits::COUNT];
diff --git a/cpp/src/qpid/log/Statement.h b/cpp/src/qpid/log/Statement.h
index 23a6fe1e54..3c67b04b20 100644
--- a/cpp/src/qpid/log/Statement.h
+++ b/cpp/src/qpid/log/Statement.h
@@ -102,10 +102,6 @@ struct Statement {
* QPID_LOG(error, boost::format("Dohickey %s exploded") % dohicky.name());
* @endcode
*
- * All code with logging statements should be built with
- * -DQPID_COMPONENT=<component name>
- * where component name is the name of the component this file belongs to.
- *
* You can subscribe to log messages by level, by component, by filename
* or a combination @see Configuration.