Commit 690dafd7 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[trac1004] also make sure 'foobar' is ignored when root is 'foo'

parent 251a32a1
......@@ -260,7 +260,7 @@ getRelatedLoggers(ConstElementPtr loggers) {
BOOST_FOREACH(ConstElementPtr cur_logger, loggers->listValue()) {
const std::string cur_name = cur_logger->get("name")->stringValue();
if (cur_name.find(root_name) == 0) {
if (cur_name == root_name || cur_name.find(root_name + ".") == 0) {
our_names.insert(cur_name);
result->add(cur_logger);
}
......
......@@ -649,11 +649,19 @@ TEST(LogConfigTest, relatedLoggersTest) {
// The default root logger name is "bind10"
doRelatedLoggersTest("[{ \"name\": \"other_module\" }]",
"[]");
doRelatedLoggersTest("[{ \"name\": \"other_module.somelib\" }]",
"[]");
doRelatedLoggersTest("[{ \"name\": \"bind10_other\" }]",
"[]");
doRelatedLoggersTest("[{ \"name\": \"bind10_other.somelib\" }]",
"[]");
doRelatedLoggersTest("[ { \"name\": \"other_module\" },"
" { \"name\": \"bind10\" }]",
"[ { \"name\": \"bind10\" } ]");
doRelatedLoggersTest("[ { \"name\": \"bind10\" }]",
"[ { \"name\": \"bind10\" } ]");
doRelatedLoggersTest("[ { \"name\": \"bind10.somelib\" }]",
"[ { \"name\": \"bind10.somelib\" } ]");
doRelatedLoggersTest("[ { \"name\": \"other_module.somelib\" },"
" { \"name\": \"bind10.somelib\" }]",
"[ { \"name\": \"bind10.somelib\" } ]");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment