<commit_before>const util = require('util');

const responses = {};

const catchers  = {
	debug:  log,
	info:   log,
	warn:   log,
	error:  log,
	fatal:  log,
};

const errorLevel = {
	debug: 0,
	info:  1,
	warn:  2,
	error: 3,
	fatal: 4,
};

const statuses = { };

var minErrorLevel = 0;

function logger(level) {
	return function (code, reasons, meta) {
		if (code instanceof CuvvaError)
			propagateError(level, code);

		var err = new CuvvaError(code, reasons, meta);

		propagateError(level, err);

		return err;
	};
}

function log(level, err) {
	// Pad so the codes of error/fatal line up with that of info and warn
	// TODO: print out inner errors instead of swallowing them (just verbose mode?)
	//       possibly not necessary as the errors are likely created with log.error anyway(?)
	var errorString = message(level, err);

	f = level == 'fatal' ? 'error' : level;
	if (f in console) {<commit_msg>Fix simple bug in logger's inner function<commit_after>const util = require('util');

const responses = {};

const catchers  = {
	debug:  log,
	info:   log,
	warn:   log,
	error:  log,
	fatal:  log,
};

const errorLevel = {
	debug: 0,
	info:  1,
	warn:  2,
	error: 3,
	fatal: 4,
};

const statuses = { };

var minErrorLevel = 0;

function logger(level) {
	return function (code, reasons, meta) {
		if (code instanceof CuvvaError) {
			propagateError(level, code);
			return code;
		}
		
		var err = new CuvvaError(code, reasons, meta);

		propagateError(level, err);

		return err;
	};
}

function log(level, err) {
	// Pad so the codes of error/fatal line up with that of info and warn
	// TODO: print out inner errors instead of swallowing them (just verbose mode?)
	//       possibly not necessary as the errors are likely created with log.error anyway(?)
	var errorString = message(level, err);

	f = level == 'fatal' ? 'error' : level;
	if (f in console) {
{'fraction_non_alphanumeric': 0.12192513368983957, 'fraction_numerical': 0.006417112299465241, 'mean_word_length': 3.433649289099526, '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': '3041379', 'n_tokens_mistral': 679, 'n_tokens_neox': 628, 'n_words': 230}