<commit_before>/**
 * Logger
 * @constructor
 * @param {string} [logCategory]
 */
yak.Log = function Log() {
    'use strict';

    var log4js = require('log4js');

    var fs = require('fs');

    var appenders = {};

    /**
     * Maximal file size in bytes.
     * @type {number}
     */
    var MAX_FILE_SIZE = 1048576;

    var MAX_NUMBER_OF_FILES = 3;

    /**
     * Initializes the logging system.
     */
    function constructor() {
        try {
            fs.mkdirSync('./logs');
        } catch (ex) {
            // Ignore the exception when the log directory already exists.
        }

        log4js.loadAppender('file');

        appenders.yakjs = log4js.appenders.file('logs/yakjs.log', null, MAX_FILE_SIZE, MAX_NUMBER_OF_FILES);

        log4js.addAppender(appenders.yakjs);
    }

    /**
     * @param {string} name
     * @returns {?} The log4js logger.
     */
    this.getLogger = function getLogger(name) {
        var logger = log4js.getLogger(name);

        if (name.indexOf('.plugin') > 0) {
            if (!appenders[name]) {
                appenders[name] = log4js.appenders.file('logs/' + name + '.log', null, MAX_FILE_SIZE, MAX_NUMBER_OF_FILES);
                log4js.addAppender(appenders[name], name);
            }

            logger = log4js.getLogger(name);
        }

        return logger;
    };

    constructor();
};
<commit_msg>Set default log level to 'INFO'<commit_after>/**
 * Logger
 * @constructor
 * @param {string} [level] The log4js log level.
 */
yak.Log = function Log(level) {
    'use strict';

    var log4js = require('log4js');

    var fs = require('fs');

    var appenders = {};

    var logLevel = level || 'INFO';

    /**
     * Maximal file size in bytes.
     * @type {number}
     */
    var MAX_FILE_SIZE = 1048576;

    var MAX_NUMBER_OF_FILES = 3;

    /**
     * Initializes the logging system.
     */
    function constructor() {
        try {
            fs.mkdirSync('./logs');
        } catch (ex) {
            // Ignore the exception when the log directory already exists.
        }

        log4js.loadAppender('file');

        appenders.yakjs = log4js.appenders.file('logs/yakjs.log', null, MAX_FILE_SIZE, MAX_NUMBER_OF_FILES);

        log4js.addAppender(appenders.yakjs);
    }

    /**
     * @param {string} name
     * @returns {?} The log4js logger.
     */
    this.getLogger = function getLogger(name) {
        var logger = log4js.getLogger(name);
        logger.setLevel(logLevel);

        if (name.indexOf('.plugin') > 0) {
            if (!appenders[name]) {
                appenders[name] = log4js.appenders.file('logs/' + name + '.log', null, MAX_FILE_SIZE, MAX_NUMBER_OF_FILES);
                log4js.addAppender(appenders[name], name);
            }

            logger = log4js.getLogger(name);
        }

        return logger;
    };

    constructor();
};

{'fraction_non_alphanumeric': 0.13777467736309731, 'fraction_numerical': 0.013603069410533658, 'mean_word_length': 2.0253164556962027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7183926', 'n_tokens_mistral': 952, 'n_tokens_neox': 896, 'n_words': 194}