Apache Log4cxx
Version 1.3.0
|
When location information is available, individual log statements can be turned on or off depending on their source location. More...
#include <locationinfofilter.h>
Public Member Functions | |
LocationInfoFilter () | |
~LocationInfoFilter () | |
void | setOption (const LogString &option, const LogString &value) override |
Set option to value . | |
void | setLineNumber (int lineNum) |
void | setMethodName (const LogString &methodName) |
void | setAcceptOnMatch (bool acceptOnMatch1) |
bool | getAcceptOnMatch () const |
bool | getMustMatchAll () const |
void | setMustMatchAll (bool mustMatchAll1) |
FilterDecision | decide (const spi::LoggingEventPtr &event) const override |
If this event does not already contain location information, evaluate the event against the expression. | |
Public Member Functions inherited from log4cxx::spi::Filter | |
Filter () | |
Filter (std::unique_ptr< FilterPrivate > priv) | |
virtual | ~Filter () |
log4cxx::spi::FilterPtr | getNext () const |
void | setNext (const log4cxx::spi::FilterPtr &newNext) |
void | activateOptions (helpers::Pool &p) override |
Activate the options that were previously set with calls to option setters. | |
void | setOption (const LogString &option, const LogString &value) override |
Set option to value . | |
virtual FilterDecision | decide (const LoggingEventPtr &event) const =0 |
Public Member Functions inherited from log4cxx::spi::OptionHandler | |
virtual | ~OptionHandler () |
virtual void | activateOptions (helpers::Pool &p)=0 |
Activate the options that were previously set with calls to option setters. | |
virtual void | setOption (const LogString &option, const LogString &value)=0 |
Set option to value . | |
Public Member Functions inherited from log4cxx::helpers::Object | |
virtual | ~Object () |
virtual const helpers::Class & | getClass () const =0 |
virtual bool | instanceof (const Class &clazz) const =0 |
virtual const void * | cast (const Class &clazz) const =0 |
Additional Inherited Members | |
Public Types inherited from log4cxx::spi::Filter | |
enum | FilterDecision { DENY = -1 , NEUTRAL = 0 , ACCEPT = 1 } |
When location information is available, individual log statements can be turned on or off depending on their source location.
This filter allows for filtering messages based off of either the line number of the message, or the name of the method that the log mesage is in. The 'operator' parameter may be used to determine if both the method name and line number must match. If 'operator' is set to 'AND', then both the line number and method name must match, otherwise only one needs to match. By default, 'operator' is set to 'OR'.
If location information is not available, this filter does nothing.
log4cxx::filter::LocationInfoFilter::LocationInfoFilter | ( | ) |
log4cxx::filter::LocationInfoFilter::~LocationInfoFilter | ( | ) |
|
overridevirtual |
If this event does not already contain location information, evaluate the event against the expression.
If the expression evaluates to true, generate a LocationInfo instance by creating an exception and set this LocationInfo on the event.
Returns log4cxx::spi::Filter#NEUTRAL
Implements log4cxx::spi::Filter.
bool log4cxx::filter::LocationInfoFilter::getAcceptOnMatch | ( | ) | const |
bool log4cxx::filter::LocationInfoFilter::getMustMatchAll | ( | ) | const |
void log4cxx::filter::LocationInfoFilter::setAcceptOnMatch | ( | bool | acceptOnMatch1 | ) |
void log4cxx::filter::LocationInfoFilter::setLineNumber | ( | int | lineNum | ) |
void log4cxx::filter::LocationInfoFilter::setMethodName | ( | const LogString & | methodName | ) |
void log4cxx::filter::LocationInfoFilter::setMustMatchAll | ( | bool | mustMatchAll1 | ) |
|
overridevirtual |
Set option
to value
.
Supported options | Supported values | Default value |
---|---|---|
Method | {any} | - |
LineNumber | {int} | - |
Operator | (1) | Or |
AcceptOnMatch | True,False | True |
(1) If "And", both method name and line number must match, otherwise either method name or line number match.
Implements log4cxx::spi::OptionHandler.