<commit_before>/*
 * Copyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*jslint sub: true*/
/*eslint-disable no-alert, no-console */

(function(){
    //#if {"excludeModes" : ["PRODUCTION", "PRODUCTIONDEBUG"]}
    /**
     * Prints log to both the console (if available), and to the aura debug component unless in production
     */
    function devDebugConsoleLog(level, message, error) {
        var stringVersion = null;
        if (!$A.util.isUndefinedOrNull(message)) {
            stringVersion = level + ": " + message;
        }
        if (!$A.util.isUndefinedOrNull(error) && !$A.util.isUndefinedOrNull(error.message)) {
            stringVersion += " : " + error.message;
        }

        var trace;
        if (error || level === "ERROR") {
            trace = $A.logger.getStackTrace(error);
        }
        var logMsg = level + ": " + (!$A.util.isUndefinedOrNull(message) ? message : "");

        if (window["console"]) {
            var console = window["console"];
            var filter = level === "WARNING" ? "warn" : level.toLowerCase();
            if (console[filter]) {
                if (!$A.util.isUndefinedOrNull(error)) {
                    console[filter](error);
                } else {
                    console[filter](message);
                }
                if (trace) {
                    for ( var j = 0; j < trace.length; j++) {
                        console[filter](trace[j]);
                    }
                }
            } else if (console["group"]) {
                console["group"](logMsg);
                if (!$A.util.isUndefinedOrNull(error)) {
                    console["debug"](error);
                } else {
                    console["debug"](message);
                }
                if (trace) {
                    console["group"]("stack");
                    for ( var i = 0; i < trace.length; i++) {
                        console["debug"](trace[i]);
                    }
                    console["groupEnd"]();
                }
                console["groupEnd"]();<commit_msg>always output the message even when there's an object argument<commit_after>/*
 * Copyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*jslint sub: true*/
/*eslint-disable no-alert, no-console */

(function(){
    //#if {"excludeModes" : ["PRODUCTION", "PRODUCTIONDEBUG"]}
    /**
     * Prints log to both the console (if available), and to the aura debug component unless in production
     */
    function devDebugConsoleLog(level, message, error) {
        var stringVersion = null;
        if (!$A.util.isUndefinedOrNull(message)) {
            stringVersion = level + ": " + message;
        }
        if (!$A.util.isUndefinedOrNull(error) && !$A.util.isUndefinedOrNull(error.message)) {
            stringVersion += " : " + error.message;
        }

        var trace;
        if (error || level === "ERROR") {
            trace = $A.logger.getStackTrace(error);
        }
        var logMsg = level + ": " + (!$A.util.isUndefinedOrNull(message) ? message : "");

        if (window["console"]) {
            var console = window["console"];
            var filter = level === "WARNING" ? "warn" : level.toLowerCase();
            if (console[filter]) {
                console[filter](message);
                if (!$A.util.isUndefinedOrNull(error)) {
                    console[filter](error);
                }
                if (trace) {
                    for ( var j = 0; j < trace.length; j++) {
                        console[filter](trace[j]);
                    }
                }
            } else if (console["group"]) {
                console["group"](logMsg);
                console["debug"](message);
                if (!$A.util.isUndefinedOrNull(error)) {
                    console["debug"](error);
                }
                if (trace) {
                    console["group"]("stack");
                    for ( var i = 0; i < trace.length; i++) {
                        console["debug"](trace[i]);
                    }
                    console["groupEnd"]();
                }
                console["groupEnd"]();
{'fraction_non_alphanumeric': 0.13021925643469973, 'fraction_numerical': 0.0038131553860819827, 'mean_word_length': 1.758149316508938, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3738419', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1344, 'n_words': 390}