Qore Logger Module Reference  0.1.1
Logger::LoggerFilterRegex Class Reference

Implements filtering according to a regular expression on the event message. More...

Inheritance diagram for Logger::LoggerFilterRegex:

Public Member Methods

 constructor (string regex_str='', bool regex_result=True)
 Creates the object. More...
 
int eval (LoggerEvent event)
 Evaluates the regex and compares with the expected result.
 
string getRegex ()
 Returns the current regex.
 
bool getRegexResult ()
 Returns the expected result.
 
 setRegex (string regex_str, bool regex_result=True)
 Sets the regular expression and the expected result for the filter. More...
 
- Public Member Methods inherited from Logger::LoggerFilter
int eval (LoggerEvent event)
 Performs filtering logic on an event and returns the decision for the event. More...
 

Private:Internal Attributes

bool regexResult
 expected result
 
string regexStr
 regular string
 

Additional Inherited Members

- Public Attributes inherited from Logger::LoggerFilter
const ACCEPT = 1
 The event will be processed.
 
const DENY = -1
 The event should not be processed.
 
const NEUTRAL = 0
 No decision could be made, further filtering should occur.
 

Detailed Description

Implements filtering according to a regular expression on the event message.

The rendered event message is tested using a regular expression, and if it does not match the expected result, then logging is rejected

Member Function Documentation

◆ constructor()

Logger::LoggerFilterRegex::constructor ( string  regex_str = '',
bool  regex_result = True 
)

Creates the object.

Parameters
regex_strthe regular expression to use
regex_resultTrue for a positive match, False for a negative match

◆ setRegex()

Logger::LoggerFilterRegex::setRegex ( string  regex_str,
bool  regex_result = True 
)

Sets the regular expression and the expected result for the filter.

Parameters
regex_strthe regular expression to use
regex_resultTrue for a positive match, False for a negative match