<commit_before>const color = require('chalk')

const loggerOptions = {
  error: {
    loggerFunction: (...x) => console.error(...x),
    prefixDefault: ' Abort ',
    prefixColor: x => color.bgRed(color.black(x)),
    messageColor: x => color.red(x)
  },
  info: {
    loggerFunction: (...x) => console.info(...x),
    prefixDefault: ' Info ',
    prefixColor: x => color.bgCyan(color.black(x)),
    messageColor: x => color.cyan(x)
  },
  warn: {
    loggerFunction: (...x) => console.warn(...x),
    prefixDefault: ' Warn ',
    prefixColor: x => color.bgYellow(color.black(x)),
    messageColor: x => color.yellow(x)
  },
  log: {
    loggerFunction: (...x) => console.log(...x),
    prefixDefault: '',
    prefixColor: x => color.bgWhite(color.black(x)),
    messageColor: x => color.white(x)
  }
}

function log({ type = 'log', message, prefix } = {}) {
  if (type in loggerOptions) {
    const args = []

    if (prefix == null) {
      prefix = loggerOptions[type].prefixDefault<commit_msg>Add success options to logger<commit_after>const color = require('chalk')

const loggerOptions = {
  error: {
    loggerFunction: (...x) => console.error(...x),
    prefixDefault: ' Abort ',
    prefixColor: x => color.bgRed(color.black(x)),
    messageColor: x => color.red(x)
  },
  info: {
    loggerFunction: (...x) => console.info(...x),
    prefixDefault: ' Info ',
    prefixColor: x => color.bgCyan(color.black(x)),
    messageColor: x => color.cyan(x)
  },
  warn: {
    loggerFunction: (...x) => console.warn(...x),
    prefixDefault: ' Warn ',
    prefixColor: x => color.bgYellow(color.black(x)),
    messageColor: x => color.yellow(x)
  },
  log: {
    loggerFunction: (...x) => console.log(...x),
    prefixDefault: '',
    prefixColor: x => color.bgWhite(color.black(x)),
    messageColor: x => color.gray(x)
  },
  success:{
    loggerFunction: (...x) => console.info(...x),
    prefixDefault: ' Done ',
    prefixColor: x => color.bgGreen(color.black(x)),
    messageColor: x => color.green(x)
  }
}

function log({ type = 'log', message, prefix } = {}) {
  if (type in loggerOptions) {
    const args = []

    if (prefix == null) {
      prefix = loggerOptions[type].prefixDefault
{'fraction_non_alphanumeric': 0.19444444444444445, 'fraction_numerical': 0.0, 'mean_word_length': 2.972875226039783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, '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': '60817', 'n_tokens_mistral': 747, 'n_tokens_neox': 743, 'n_words': 153}