<commit_before>import chalk from 'chalk';

/* eslint-disable */
const doLog = (color, args) => {
  let message = Array.prototype.slice.call(args, 0).join(' ');
  if (color) {
    message = color(message);
  }

  console.log(message);
};

export const log = function() { doLog(null, arguments); };
export const logWarning = function() { doLog(chalk.yellow, arguments); };
export const logError = function() { doLog(chalk.red, arguments); };
<commit_msg>output stack traces for errors<commit_after>import _ from 'lodash';
import chalk from 'chalk';

/* eslint-disable */
const doLog = (color, args) => {
  let message = _.map(args, a => a instanceof Error ? a.stack : a).join(' ');

  if (color) {
    message = color(message);
  }

  console.log(message);
};

export const log = function() { doLog(null, arguments); };
export const logWarning = function() { doLog(chalk.yellow, arguments); };
export const logError = function() { doLog(chalk.red, arguments); };

{'fraction_non_alphanumeric': 0.16649323621227888, 'fraction_numerical': 0.001040582726326743, 'mean_word_length': 4.374301675977653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '852067', 'n_tokens_mistral': 311, 'n_tokens_neox': 301, 'n_words': 84}