public class LogMatcher
extends java.lang.Object
The purpose of this object is to have a centralized way to check each log against the given set of constraints before deciding it can be injected in the system.
In particular it checks a log against the followings:
| Modifier and Type | Field and Description |
|---|---|
protected LogTypeHelper |
actualDiscardLevel
The discard level
|
| Constructor and Description |
|---|
LogMatcher() |
| Modifier and Type | Method and Description |
|---|---|
LogTypeHelper |
getActualDiscardLevel()
Return the discard level used to filter out logs.
|
Audience |
getAudience() |
FiltersVector |
getFilters() |
boolean |
match(ILogEntry log)
Check if the passed log matches with the constraints.
|
void |
setAudience(Audience newAudience)
Set the audience
|
void |
setDiscardLevel(LogTypeHelper discardLevel) |
void |
setFilters(FiltersVector filters)
Set the filters to apply to incoming logs before sending to
the listeners
|
protected volatile LogTypeHelper actualDiscardLevel
public void setFilters(FiltersVector filters)
filters - The filters to apply
If null or empty the filtering is disabledpublic void setAudience(Audience newAudience)
newAudience - The new audience as defined in log_audience IDL moduleLCEngine.setFilters()public Audience getAudience()
public void setDiscardLevel(LogTypeHelper discardLevel)
discardLevel - the discardLevel to setpublic FiltersVector getFilters()
public final boolean match(ILogEntry log)
The log is checked in the following order:
log - The not null log to checktrue if the log matches the criteriapublic LogTypeHelper getActualDiscardLevel()