public abstract class EventFilter
extends java.lang.Object
See the companion object for convenient factory methods.
If the occurrences
is set to Int.MaxValue, no tracking is done.
Constructor and Description |
---|
EventFilter(int occurrences) |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Logging.LogEvent event) |
void |
assertDone(scala.concurrent.duration.Duration max)
Assert that this filter has matched as often as requested by its
occurrences parameter specifies. |
boolean |
awaitDone(scala.concurrent.duration.Duration max) |
protected boolean |
complete() |
static EventFilter |
custom(scala.PartialFunction<Logging.LogEvent,java.lang.Object> test,
int occurrences)
Create a custom event filter.
|
static EventFilter |
debug(java.lang.String message,
java.lang.String source,
java.lang.String start,
java.lang.String pattern,
int occurrences)
Create a filter for Debug events.
|
protected boolean |
doMatch(java.lang.String src,
java.lang.Object msg)
internal implementation helper, no guaranteed API
|
static EventFilter |
error(java.lang.String message,
java.lang.String source,
java.lang.String start,
java.lang.String pattern,
int occurrences)
Create a filter for Error events which do not have a cause set (i.e.
|
static EventFilter |
info(java.lang.String message,
java.lang.String source,
java.lang.String start,
java.lang.String pattern,
int occurrences)
Create a filter for Info events.
|
<T> T |
intercept(scala.Function0<T> code,
ActorSystem system)
Apply this filter while executing the given code block.
|
protected abstract boolean |
matches(Logging.LogEvent event)
This method decides whether to filter the event (
true ) or not
(false ). |
protected scala.util.Either<java.lang.String,scala.util.matching.Regex> |
message() |
protected scala.Option<java.lang.String> |
source() |
static EventFilter |
warning(java.lang.String message,
java.lang.String source,
java.lang.String start,
java.lang.String pattern,
int occurrences)
Create a filter for Warning events.
|
public static EventFilter error(java.lang.String message, java.lang.String source, java.lang.String start, java.lang.String pattern, int occurrences)
message
- (undocumented)source
- (undocumented)start
- (undocumented)pattern
- (undocumented)occurrences
- (undocumented)public static EventFilter warning(java.lang.String message, java.lang.String source, java.lang.String start, java.lang.String pattern, int occurrences)
start
and pattern
:
EventFilter.warning() // filter only on warning event
EventFilter.warning(source = obj) // filter on event source
EventFilter.warning(start = "Expected") // filter on start of message
EventFilter.warning(source = obj, pattern = "weird.*message") // filter on pattern and message
''Please note that filtering on the source
being
null
does NOT work (passing null
disables the
source filter).''
message
- (undocumented)source
- (undocumented)start
- (undocumented)pattern
- (undocumented)occurrences
- (undocumented)public static EventFilter info(java.lang.String message, java.lang.String source, java.lang.String start, java.lang.String pattern, int occurrences)
start
and pattern
:
EventFilter.info() // filter only on info event
EventFilter.info(source = obj) // filter on event source
EventFilter.info(start = "Expected") // filter on start of message
EventFilter.info(source = obj, pattern = "weird.*message") // filter on pattern and message
''Please note that filtering on the source
being
null
does NOT work (passing null
disables the
source filter).''
message
- (undocumented)source
- (undocumented)start
- (undocumented)pattern
- (undocumented)occurrences
- (undocumented)public static EventFilter debug(java.lang.String message, java.lang.String source, java.lang.String start, java.lang.String pattern, int occurrences)
start
and pattern
:
EventFilter.debug() // filter only on debug type
EventFilter.debug(source = obj) // filter on event source
EventFilter.debug(start = "Expected") // filter on start of message
EventFilter.debug(source = obj, pattern = "weird.*message") // filter on pattern and message
''Please note that filtering on the source
being
null
does NOT work (passing null
disables the
source filter).''
message
- (undocumented)source
- (undocumented)start
- (undocumented)pattern
- (undocumented)occurrences
- (undocumented)public static EventFilter custom(scala.PartialFunction<Logging.LogEvent,java.lang.Object> test, int occurrences)
true
.
EventFilter.custom {
case Warning(ref, "my warning") if ref == actor || ref == null => true
}
test
- (undocumented)occurrences
- (undocumented)protected abstract boolean matches(Logging.LogEvent event)
true
) or not
(false
).event
- (undocumented)public final boolean apply(Logging.LogEvent event)
public boolean awaitDone(scala.concurrent.duration.Duration max)
public void assertDone(scala.concurrent.duration.Duration max)
occurrences
parameter specifies.max
- (undocumented)public <T> T intercept(scala.Function0<T> code, ActorSystem system)
code
- (undocumented)system
- (undocumented)protected scala.Option<java.lang.String> source()
protected scala.util.Either<java.lang.String,scala.util.matching.Regex> message()
protected boolean complete()
protected boolean doMatch(java.lang.String src, java.lang.Object msg)
src
- (undocumented)msg
- (undocumented)