com.github.triceo.splitlog.conditions.SplitlogMessagesRejectingCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of splitlog-core Show documentation
Show all versions of splitlog-core Show documentation
These are the core parts of splitlog. This is where the implementations of the public APIs live. Classes from this package come with no API stability guarantees.
package com.github.triceo.splitlog.conditions;
import com.github.triceo.splitlog.api.Message;
import com.github.triceo.splitlog.api.SimpleMessageCondition;
import com.github.triceo.splitlog.api.TailSplitter;
import com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter;
import com.github.triceo.splitlog.splitters.SimpleTailSplitter;
/**
* This will accept any {@link Message} whose {@link Message#getLogger()}
* doesn't start with com.github.triceo.splitlog.
*
* This requires that the {@link JBossServerLogTailSplitter} or any other smart
* {@link TailSplitter} be used. {@link SimpleTailSplitter} will not provide the
* logger information and therefore this condition will not work together with.
*/
public final class SplitlogMessagesRejectingCondition implements SimpleMessageCondition {
public static final SplitlogMessagesRejectingCondition INSTANCE = new SplitlogMessagesRejectingCondition();
private SplitlogMessagesRejectingCondition() {
// singleton
}
@Override
public boolean accept(final Message evaluate) {
if (evaluate.getLogger().startsWith("com.github.triceo.splitlog")) {
return false;
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy