Package org.logevents.observers
Class ConditionalLogEventObserver
- java.lang.Object
-
- org.logevents.observers.ConditionalLogEventObserver
-
- All Implemented Interfaces:
LogEventObserver
public class ConditionalLogEventObserver extends Object implements LogEventObserver
An observer that filters log messages by a given conditions, forwarding those that match the condition to a delegate observer
-
-
Constructor Summary
Constructors Constructor Description ConditionalLogEventObserver(LogEventObserver delegate, LogEventPredicate predicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogEventPredicate
getCondition()
LogEventObserver
getObserver()
boolean
isEnabled()
boolean
isEnabled(org.slf4j.Marker marker)
void
logEvent(LogEvent logEvent)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.logevents.LogEventObserver
filteredOn, stream, toList
-
-
-
-
Constructor Detail
-
ConditionalLogEventObserver
public ConditionalLogEventObserver(LogEventObserver delegate, LogEventPredicate predicate)
-
-
Method Detail
-
logEvent
public void logEvent(LogEvent logEvent)
- Specified by:
logEvent
in interfaceLogEventObserver
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceLogEventObserver
-
isEnabled
public boolean isEnabled(org.slf4j.Marker marker)
- Specified by:
isEnabled
in interfaceLogEventObserver
-
getCondition
public LogEventPredicate getCondition()
-
getObserver
public LogEventObserver getObserver()
-
-