NopeCharon opened a new pull request, #822:
URL: https://github.com/apache/logging-log4cxx/pull/822

   Fixes #821
   
   ## Problem
   
   The `LocationInfoFilter` documentation says a `Method` value looks like 
`Class::methodName`. But `decide()` compared the option value with 
`LocationInfo::getMethodName()`, which removes the class and namespace names. 
So a qualified value never matched and the filter silently did nothing.
   
   Also, `setOption` started with a leftover `LogLog::warn(option + ":" + 
value)`. Because of this, every `LocationInfoFilter` option wrote a warning to 
stderr, even when internal debugging was off.
   
   ## Change
   
   - A `Method` value that contains `::` is compared with the logging request's 
method name qualified by its class. It matches the whole qualified name, or a 
trailing part of it that starts right after a `::` separator. An unqualified 
value is compared with the method name, as before.
   
     For a logging request in `void ns::Example::exampleFun(int)`:
   
     | `Method` value | Before | After |
     | --- | --- | --- |
     | `exampleFun` | match | match |
     | `Example::exampleFun` | no match | match |
     | `ns::Example::exampleFun` | no match | match |
     | `ample::exampleFun`, `Other::exampleFun`, `Example::otherFun` | no match 
| no match |
   
   - Removed the stray warning from `setOption`, along with the `loglog.h` 
include it was the only user of.
   - Updated the `Method` option description in the class reference and on the 
filters page.
   - New tests: `LocationInfoFilterTest::test5` (unqualified and qualified 
values match) and `test6` (non-matching qualified values). Both set options 
with `setOption`, the same way a configuration file does.
   
   No public interface changes; the matching helper is internal to 
`locationinfofilter.cpp`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] Match a qualified Method va... NopeCharon (via GitHub) via notifications

Reply via email to