<commit_before>export class ConsoleReporter {

  constructor(options) {
    this.console = options.console;
  }

  receive(log) {
    var {level, group, message} = log;
    var processed = `[${level}|${group}] ${message}`;

    if (level === 'fatal') {
      this.error(processed);
    } else {
      this[level](processed);
    }
  }

  info(message) {
    this.console.info(message);
  }

  warn(message) {
    this.console.warn(message);
  }

  error(message) {
    this.console.error(message);
  }
}
<commit_msg>feature(ConsoleReporter): fallback to the window.console if one isn't provided via the constructor<commit_after>export class ConsoleReporter {

  constructor(options) {
    this.console = options.console || window.console;
  }

  receive(log) {
    var {level, group, message} = log;
    var processed = `[${level}|${group}] ${message}`;

    if (level === 'fatal') {
      this.error(processed);
    } else {
      this[level](processed);
    }
  }

  info(message) {
    this.console.info(message);
  }

  warn(message) {
    this.console.warn(message);
  }

  error(message) {
    this.console.error(message);
  }
}

{'fraction_non_alphanumeric': 0.15859030837004406, 'fraction_numerical': 0.0, 'mean_word_length': 3.0863309352517985, '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': '7555516', 'n_tokens_mistral': 386, 'n_tokens_neox': 368, 'n_words': 68}