<commit_before>package name.prokop.bart.logback;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
import java.util.ArrayList;
import java.util.List;

public class MemoryAppender extends AppenderBase<ILoggingEvent> {

    private int limit = 150;
    private final List<ILoggingEvent> events = new ArrayList<>();

    @Override
    public void start() {
        super.start();
        MemoryAppenderInstance.setInstance(this);
    }

    @Override
    public void stop() {
        MemoryAppenderInstance.setInstance(null);
        super.stop();
        events.clear();
    }

    @Override
    protected void append(ILoggingEvent e) {
        synchronized (events) {<commit_msg>Adding memory appender for Logback<commit_after>package name.prokop.bart.logback;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
import java.util.ArrayList;
import java.util.List;

/**
 * This class provides a in-memory logging appender for logback.
 *
 * @author <NAME>
 */
public class MemoryAppender extends AppenderBase<ILoggingEvent> {

    private int limit = 150;
    private final List<ILoggingEvent> events = new ArrayList<>();

    @Override
    public void start() {
        super.start();
        MemoryAppenderInstance.setInstance(this);
    }

    @Override
    public void stop() {
        MemoryAppenderInstance.setInstance(null);
        super.stop();
        events.clear();
    }

    @Override
    protected void append(ILoggingEvent e) {
        synchronized (events) {
{'fraction_non_alphanumeric': 0.10367031551835158, 'fraction_numerical': 0.0038634900193174502, 'mean_word_length': 3.2575342465753425, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4624835', 'n_tokens_mistral': 471, 'n_tokens_neox': 457, 'n_words': 105}