<commit_before>/*
 * This is a shim logging module for use in the browser.
 *
 * Our server-side logging library doesn't work client-side.  This just
 * implements the interface with basic output to `console.log`.
 *
 * TODO: For production use we should mimic the interface with NOOPs.
 *
 */

var common = require('./common')

var _console = (typeof console === 'undefined')
	?{
		// IE9 doesn't even _define_ console unless the dev tools are open.
		log   : () => {},
		error : () => {},
		warn  : () => {},
		debug : () => {},
		info  : () => {},
	}
	:{
		// IE9 also needs a real function for `apply` to work.
		log   : Function.prototype.bind.call(console.log,   console),
		error : Function.prototype.bind.call(console.error, console),
		warn  : Function.prototype.bind.call(console.warn,  console),
		debug : Function.prototype.bind.call(console.debug, console),
		info  : Function.prototype.bind.call(console.info,  console),
	};

var lvl_map = {<commit_msg>Factor out some commonality<commit_after>/*
 * This is a shim logging module for use in the browser.
 *
 * Our server-side logging library doesn't work client-side.  This just
 * implements the interface with basic output to `console.log`.
 *
 * TODO: For production use we should mimic the interface with NOOPs.
 *
 */

var common = require('./common')

var _console = ['log','error','warn','debug','info'].reduce((m,v) => {
	// IE9 doesn't even _define_ console unless the dev tools are open.
	// IE9 also needs a real function for `apply` to work.
	m[v] = (typeof console === 'undefined')
		?() => {}
		:Function.prototype.bind.call(console[v], console)
	return m;
}, {});

var lvl_map = {
{'fraction_non_alphanumeric': 0.14707655213984328, 'fraction_numerical': 0.0024110910186859553, 'mean_word_length': 3.5231607629427795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4143076', 'n_tokens_mistral': 526, 'n_tokens_neox': 505, 'n_words': 171}