All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.triceo.splitlog.conditions.SplitlogMessagesRejectingCondition Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.7.2
Show newest version
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