<commit_before>package com.thesett.util.log4j;

import java.text.MessageFormat;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

import org.apache.log4j.Logger;
import org.apache.log4j.Priority;

/**
 * LoggingToLog4JHandler is a java.util.logging handler that redirects all of its output onto Log4J.
 *
 * <pre><p/><table id="crc"><caption>CRC Card</caption>
 * <tr><th> Responsibilities <th> Collaborations
 * <tr><td> Publish a java.util.logging message to Log4J.
 * </table></pre>
 *
 * @author <NAME>
 */
public class LoggingToLog4JHandler extends Handler
{
    /**
     * Provides the target Log4J logger for a class, by name.
     *
     * @param  clazz The class to get the logger for.
     *
     * @return The target Log4J logger.
     */
    public static Logger getTargetLogger(Class clazz)
    {
        return getTargetLogger(clazz.getName());
    }

    /**
     * Provides the target Log4J logger.
     *
     * @param  loggerName The name of the logger.
     *
     * @return The target Log4J logger.
     */
    public static Logger getTargetLogger(String loggerName)
    {
        return Logger.getLogger(loggerName);
    }

    /** {@inheritDoc} */
    public void publish(LogRecord record)
    {
        org.apache.log4j.Logger log4j = getTargetLogger(record.getLoggerName());
        Priority priority = toLog4j(record.getLevel());
        log4j.log(priority, toLog4jMessage(record), record.getThrown());
    }

    /** {@inheritDoc} */
    public void flush()
    {
    }
<commit_msg>Filtered out log statements with level OFF.<commit_after>package com.thesett.util.log4j;

import java.text.MessageFormat;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

import org.apache.log4j.Logger;
import org.apache.log4j.Priority;

/**
 * LoggingToLog4JHandler is a java.util.logging handler that redirects all of its output onto Log4J.
 *
 * <pre><p/><table id="crc"><caption>CRC Card</caption>
 * <tr><th> Responsibilities <th> Collaborations
 * <tr><td> Publish a java.util.logging message to Log4J.
 * </table></pre>
 *
 * @author <NAME>
 */
public class LoggingToLog4JHandler extends Handler
{
    /**
     * Provides the target Log4J logger for a class, by name.
     *
     * @param  clazz The class to get the logger for.
     *
     * @return The target Log4J logger.
     */
    public static Logger getTargetLogger(Class clazz)
    {
        return getTargetLogger(clazz.getName());
    }

    /**
     * Provides the target Log4J logger.
     *
     * @param  loggerName The name of the logger.
     *
     * @return The target Log4J logger.
     */
    public static Logger getTargetLogger(String loggerName)
    {
        return Logger.getLogger(loggerName);
    }

    /** {@inheritDoc} */
    public void publish(LogRecord record)
    {
        org.apache.log4j.Logger log4j = getTargetLogger(record.getLoggerName());
        Priority priority = toLog4j(record.getLevel());

        if (!priority.equals(org.apache.log4j.Level.OFF))
        {
            log4j.log(priority, toLog4jMessage(record), record.getThrown());
        }
    }

    /** {@inheritDoc} */
    public void flush()
    {
    }

{'fraction_non_alphanumeric': 0.11839258114374034, 'fraction_numerical': 0.010200927357032458, 'mean_word_length': 2.8523809523809525, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '4741038', 'n_tokens_mistral': 1023, 'n_tokens_neox': 1005, 'n_words': 252}