<commit_before>package de.is24.deadcode4j.junit;

import com.google.common.base.Strings;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.logging.SystemStreamLog;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.slf4j.impl.StaticLoggerBinder;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;

public class LoggingRule extends TestWatcher {

    private final Log log;

    public LoggingRule(Log log) {
        this.log = log;
    }

    public LoggingRule() {
        this(new SystemStreamLog() {
            @Override
            public boolean isDebugEnabled() {
                return true;
            }
        });
    }

    public static Log createMock() {
        Log logMock = mock(Log.class);
        when(logMock.isDebugEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("DEBUG")).when(logMock).debug(any(CharSequence.class));
        when(logMock.isInfoEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("INFO")).when(logMock).info(any(CharSequence.class));
        when(logMock.isWarnEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("WARN")).when(logMock).warn(any(CharSequence.class));
        when(logMock.isErrorEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("ERROR")).when(logMock).error(any(CharSequence.class));
        return logMock;
    }

    @Override
    protected void starting(Description description) {
        StaticLoggerBinder.getSingleton().setLog(log);
    }
<commit_msg>use the logger that capitalizes the log level<commit_after>package de.is24.deadcode4j.junit;

import com.google.common.base.Strings;
import org.apache.maven.monitor.logging.DefaultLog;
import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.slf4j.impl.StaticLoggerBinder;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;

public class LoggingRule extends TestWatcher {

    private final Log log;

    public LoggingRule(Log log) {
        this.log = log;
    }

    public LoggingRule() {
        this(new DefaultLog(new ConsoleLogger(Logger.LEVEL_DEBUG, "junit")));
    }

    public static Log createMock() {
        Log logMock = mock(Log.class);
        when(logMock.isDebugEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("DEBUG")).when(logMock).debug(any(CharSequence.class));
        when(logMock.isInfoEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("INFO")).when(logMock).info(any(CharSequence.class));
        when(logMock.isWarnEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("WARN")).when(logMock).warn(any(CharSequence.class));
        when(logMock.isErrorEnabled()).thenReturn(true);
        doAnswer(new LogAnswer("ERROR")).when(logMock).error(any(CharSequence.class));
        return logMock;
    }

    @Override
    protected void starting(Description description) {
        StaticLoggerBinder.getSingleton().setLog(log);
    }

{'fraction_non_alphanumeric': 0.12496199452721192, 'fraction_numerical': 0.002432350258437215, 'mean_word_length': 3.8240469208211145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7317348', 'n_tokens_mistral': 1007, 'n_tokens_neox': 974, 'n_words': 157}