CountingHandler xref

View Javadoc

    1   package org.slf4j.helpers;
    2
    3   import java.util.concurrent.atomic.AtomicLong;
    4   import java.util.logging.Handler;
    5   import java.util.logging.LogRecord;
    6
    7   public class CountingHandler extends Handler {
    8
    9       final AtomicLong eventCount = new AtomicLong(0);
    10
    11      @Override
    12      public void publish(LogRecord record) {
    13          eventCount.getAndIncrement();
    14      }
    15
    16      @Override
    17      public void flush() {
    18      }
    19
    20      @Override
    21      public void close() throws SecurityException {
    22      }
    23
    24  }