<commit_before>/*global document*/
"use strict";

var insertCss = require("insert-css");
var substituteStrings = require("./substituteStrings");

var element;
var elementName;

var console = function (name) {
    elementName = name;
    return console;
};

function actuallyAppendChild(el) {
    element.appendChild(el);
}

function insertStyle() {
    var css = 'pre.consoleit {margin:0 0 0 20px; position:relative}' +
              'pre.consoleit:before {position:absolute; left:-15px}' +
              'pre.consoleit.info:before {content:"\\25CF"; color:#4072B4}' +
              'pre.consoleit.warn:before {content:"\\25B2"; color:#ffcc09}' +
              'pre.consoleit.error:before {content:"\\25A0"; color:#ff0909}';
    insertCss(css);
}

function determineElement(el) {
    insertStyle(); // First time through, insert our style sheet.
    element = elementName ? document.getElementById(elementName) : document.body;
    appendChild = actuallyAppendChild; // Reassign. Isn't JavaScript cool?
    appendChild(el);
}

var appendChild = determineElement;

function outputCommon(method) {
    var args = Array.prototype.slice.call(arguments, 1);
    var text = substituteStrings(args);
    var el = document.createElement("pre");
    el.className = "consoleit " + method;
    el.textContent = text;
    appendChild(el);<commit_msg>Make empty string display a blank line.<commit_after>/*global document*/
"use strict";

var insertCss = require("insert-css");
var substituteStrings = require("./substituteStrings");

var element;
var elementName;

var console = function (name) {
    elementName = name;
    return console;
};

function actuallyAppendChild(el) {
    element.appendChild(el);
}

function insertStyle() {
    var css = 'pre.consoleit {margin:0 0 0 20px; position:relative}' +
              'pre.consoleit:before {position:absolute; left:-15px}' +
              'pre.consoleit.info:before {content:"\\25CF"; color:#4072B4}' +
              'pre.consoleit.warn:before {content:"\\25B2"; color:#ffcc09}' +
              'pre.consoleit.error:before {content:"\\25A0"; color:#ff0909}';
    insertCss(css);
}

function determineElement(el) {
    insertStyle(); // First time through, insert our style sheet.
    element = elementName ? document.getElementById(elementName) : document.body;
    appendChild = actuallyAppendChild; // Reassign. Isn't JavaScript cool?
    appendChild(el);
}

var appendChild = determineElement;

function outputCommon(method) {
    var args = Array.prototype.slice.call(arguments, 1);
    var text = substituteStrings(args) || " ";
    var el = document.createElement("pre");
    el.className = "consoleit " + method;
    el.textContent = text;
    appendChild(el);
{'fraction_non_alphanumeric': 0.13842746400885936, 'fraction_numerical': 0.019933554817275746, 'mean_word_length': 3.7460595446584937, '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': '5784157', 'n_tokens_mistral': 828, 'n_tokens_neox': 783, 'n_words': 185}