Mercurial Hosting > nabble
view src/fschmidt/util/log4j/CountingEvaluator.java @ 69:4bc1fc540265 default tip
update luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Oct 2025 20:45:39 -0600 |
parents | 00520880ad02 |
children |
line wrap: on
line source
package fschmidt.util.log4j; import org.apache.log4j.spi.LoggingEvent; import org.apache.log4j.spi.TriggeringEventEvaluator; public final class CountingEvaluator implements TriggeringEventEvaluator { private final int limit; private int count = 0; public CountingEvaluator(int limit) { this.limit = limit; } public boolean isTriggeringEvent(LoggingEvent event) { if( ++count < limit ) { return false; } else { count = 0; return true; } } }