diff --git a/src/base/match.cc b/src/base/match.cc index dc621b482f..03f425f2e5 100644 --- a/src/base/match.cc +++ b/src/base/match.cc @@ -43,6 +43,12 @@ ObjectMatch::ObjectMatch(const string &expr) setExpression(expr); } +void +ObjectMatch::add(const ObjectMatch &other) +{ + tokens.insert(tokens.end(), other.tokens.begin(), other.tokens.end()); +} + void ObjectMatch::setExpression(const string &expr) { diff --git a/src/base/match.hh b/src/base/match.hh index 6e1f03b804..3ef4c81921 100644 --- a/src/base/match.hh +++ b/src/base/match.hh @@ -47,6 +47,7 @@ class ObjectMatch public: ObjectMatch(); ObjectMatch(const std::string &expression); + void add(const ObjectMatch &other); void setExpression(const std::string &expression); void setExpression(const std::vector &expression); bool match(const std::string &name) const diff --git a/src/base/trace.hh b/src/base/trace.hh index ddf936ecd7..ee8737243e 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -86,6 +86,9 @@ class Logger /** Set objects to ignore */ void setIgnore(ObjectMatch &ignore_) { ignore = ignore_; } + /** Add objects to ignore */ + void addIgnore(const ObjectMatch &ignore_) { ignore.add(ignore_); } + virtual ~Logger() { } }; diff --git a/src/python/pybind11/debug.cc b/src/python/pybind11/debug.cc index 8fcd0cdbcc..de8b103163 100644 --- a/src/python/pybind11/debug.cc +++ b/src/python/pybind11/debug.cc @@ -75,7 +75,7 @@ ignore(const char *expr) { ObjectMatch ignore(expr); - Trace::getDebugLogger()->setIgnore(ignore); + Trace::getDebugLogger()->addIgnore(ignore); } void