<commit_before>/*
 * Provides a simple logger.
 */
function Logger()
{
    this.OFF = false;
    this.FATAL = true;
    this.ERROR = true;
    this.WARN = true;
    this.INFO = true;
    this.DEBUG = true;
    this.TRACE = true;

    this.isOffEnabled = function()
    {
        return this.OFF;
    }

    this.isFatalEnabled = function()
    {
        return this.FATAL;
    }

    this.isErrorEnabled = function()
    {
        return this.ERROR;
    }

    this.isWarnEnabled = function()
    {
        return this.WARN;
    }

    this.isInfoEnabled = function()
    {
        return this.INFO;
    }

    this.isDebugEnabled = function()
    {
        return this.DEBUG;
    }

    this.isTraceEnabled = function()
    {
        return this.TRACE;
    }

    this.setOffEnabled = function(isEnabled)
    {
        this.OFF = isEnabled;
    }

    this.setFatalEnabled = function(isEnabled)
    {
        this.FATAL = isEnabled;
    }

    this.setErrorEnabled = function(isEnabled)
    {
        this.ERROR = isEnabled;
    }

    this.setWarnEnabled = function(isEnabled)
    {
        this.WARN = isEnabled;
    }

    this.setInfoEnabled = function(isEnabled)
    {
        this.INFO = isEnabled;
    }

    this.setDebugEnabled = function(isEnabled)
    {
        this.DEBUG = isEnabled;
    }

    this.setTraceEnabled = function(isEnabled)
    {
        this.TRACE = isEnabled;
    }

    this.fatal = function(message)
    {
        if (!this.OFF && this.FATAL)
        {
            console.log(getDateString() + " FATAL " + message);
        }
    }

    this.error = function(message)
    {
        if (!this.OFF && this.ERROR)
        {
            console.log(getDateString() + " ERROR " + message);
        }
    }

    this.warn = function(message)
    {
        if (!this.OFF && this.WARN)
        {
            console.log(getDateString() + " WARN  " + message);
        }
    }

    this.info = function(message)
    {
        if (!this.OFF && this.INFO)
        {
            console.log(getDateString() + " INFO  " + message);
        }
    }

    this.debug = function(message)
    {
        if (!this.OFF && this.DEBUG)
        {
            console.log(getDateString() + " DEBUG " + message);
        }
    }

    this.trace = function(message)
    {
        if (!this.OFF && this.TRACE)
        {
            console.log(getDateString() + " TRACE " + message);
        }
    }

    function getDateString()
    {
        var date = new Date();
        var hours = date.getHours();
        if (hours < 10)
        {
            hours = "0" + hours;
        }

        var minutes = date.getMinutes();
        if (minutes < 10)
        {
            minutes = "0" + minutes;
        }

        var seconds = date.getSeconds();
        if (seconds < 10)
        {
            seconds = "0" + seconds;
        }

        var millis = date.getMilliseconds();<commit_msg>Enhanced to use the new TimePrinter.<commit_after>/*
 * Provides a simple logger.
 */
function Logger()
{
    this.OFF = false;
    this.FATAL = true;
    this.ERROR = true;
    this.WARN = true;
    this.INFO = true;
    this.DEBUG = true;
    this.TRACE = true;

    this.TIME = true;

    this.isOffEnabled = function()
    {
        return this.OFF;
    }

    this.isFatalEnabled = function()
    {
        return this.FATAL;
    }

    this.isErrorEnabled = function()
    {
        return this.ERROR;
    }

    this.isWarnEnabled = function()
    {
        return this.WARN;
    }

    this.isInfoEnabled = function()
    {
        return this.INFO;
    }

    this.isDebugEnabled = function()
    {
        return this.DEBUG;
    }

    this.isTimeEnabled = function()
    {
        return this.TIME;
    }

    this.isTraceEnabled = function()
    {
        return this.TRACE;
    }

    this.setOffEnabled = function(isEnabled)
    {
        this.OFF = isEnabled;
    }

    this.setFatalEnabled = function(isEnabled)
    {
        this.FATAL = isEnabled;
    }

    this.setErrorEnabled = function(isEnabled)
    {
        this.ERROR = isEnabled;
    }

    this.setWarnEnabled = function(isEnabled)
    {
        this.WARN = isEnabled;
    }

    this.setInfoEnabled = function(isEnabled)
    {
        this.INFO = isEnabled;
    }

    this.setDebugEnabled = function(isEnabled)
    {
        this.DEBUG = isEnabled;
    }

    this.setTimeEnabled = function(isEnabled)
    {
        this.TIME = isEnabled;
    }

    this.setTraceEnabled = function(isEnabled)
    {
        this.TRACE = isEnabled;
    }

    this.fatal = function(message)
    {
        if (!this.OFF && this.FATAL)
        {
            console.log(getDateString() + " FATAL " + message);
        }
    }

    this.error = function(message)
    {
        if (!this.OFF && this.ERROR)
        {
            console.log(getDateString() + " ERROR " + message);
        }
    }

    this.warn = function(message)
    {
        if (!this.OFF && this.WARN)
        {
            console.log(getDateString() + " WARN  " + message);
        }
    }

    this.info = function(message)
    {
        if (!this.OFF && this.INFO)
        {
            console.log(getDateString() + " INFO  " + message);
        }
    }

    this.debug = function(message)
    {
        if (!this.OFF && this.DEBUG)
        {
            console.log(getDateString() + " DEBUG " + message);
        }
    }

    this.time = function(title, start, end)
    {
        if (!this.OFF && this.TIME)
        {
            var message = TimePrinter.formatElapsedTime(title, start, end);
            console.log(getDateString() + " TIME " + message);
        }
    }

    this.trace = function(message)
    {
        if (!this.OFF && this.TRACE)
        {
            console.log(getDateString() + " TRACE " + message);
        }
    }

    function getDateString()
    {
        var date = new Date();
        var hours = date.getHours();
        if (hours < 10)
        {
            hours = "0" + hours;
        }

        var minutes = date.getMinutes();
        if (minutes < 10)
        {
            minutes = "0" + minutes;
        }

        var seconds = date.getSeconds();
        if (seconds < 10)
        {
            seconds = "0" + seconds;
        }

        var millis = date.getMilliseconds();
{'fraction_non_alphanumeric': 0.12366021436570149, 'fraction_numerical': 0.0028795392737162055, 'mean_word_length': 1.5404307192198294, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5505503', 'n_tokens_mistral': 2002, 'n_tokens_neox': 1927, 'n_words': 351}