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/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.