<commit_before>'use strict';

var raven = require('raven');
var layouts = require('log4js').layouts;

/**
 * The appender function.
 *
 * @param {String} dsn The Sentry URL to post events to.
 * @param {String} layout The layout to use to format the message.
 * @param {String} level The log level to use as an override for the main category level.
 *
 * @return {Function} Returns the
 */
function sentryAppender(dsn, layout, level) {

    // Create a new instance of the client
    var client = new raven.Client(dsn);

    layout = layout || layouts.messagePassThroughLayout;

    return function(logEvent) {

        // Check if the log level is enabled
        if (!level || logEvent.level.isGreaterThanOrEqualTo(level)) {

            // Format the log message
            var message = layout(logEvent);

            console.log('Message:', message);

            // Forward the message to Sentry
            client.captureMessage(message, {
                level: logEvent.level.toString().toLowerCase()
            });

        }

    };
}

/**
 * Configures the appender.<commit_msg>Removed `console.log()` statement<commit_after>'use strict';

var raven = require('raven');
var layouts = require('log4js').layouts;

/**
 * The appender function.
 *
 * @param {String} dsn The Sentry URL to post events to.
 * @param {String} layout The layout to use to format the message.
 * @param {String} level The log level to use as an override for the main category level.
 *
 * @return {Function} Returns the
 */
function sentryAppender(dsn, layout, level) {

    // Create a new instance of the client
    var client = new raven.Client(dsn);

    layout = layout || layouts.messagePassThroughLayout;

    return function(logEvent) {

        // Check if the log level is enabled
        if (!level || logEvent.level.isGreaterThanOrEqualTo(level)) {

            // Format the log message
            var message = layout(logEvent);

            // Forward the message to Sentry
            client.captureMessage(message, {
                level: logEvent.level.toString().toLowerCase()
            });

        }

    };
}

/**
 * Configures the appender.
{'fraction_non_alphanumeric': 0.10894761242466389, 'fraction_numerical': 0.0009272137227630969, 'mean_word_length': 2.549342105263158, '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': '7407770', 'n_tokens_mistral': 606, 'n_tokens_neox': 583, 'n_words': 203}