<commit_before>'use strict';

let log = require('intel');

module.exports.configure = function configure(options, logDir) {
  options = options || {};

  let level = log.INFO;
  switch (options.verbose) {
    case 1:
      level = log.DEBUG;
      break;
    case 2:
      level = log.VERBOSE;
      break;
    case 3:
      level = log.TRACE;
      break;
    default:
      break;
  }

  if (options.silent) {
    level = log.NONE;
  }

  log.basicConfig({
    'format': '[%(date)s] %(message)s',
    'level': level
  });

  log.addHandler(new log.handlers.File(logDir + '/sitespeed.io.log'));
};
<commit_msg>always log level and set date and level on file log (#1524)<commit_after>'use strict';

let log = require('intel');

module.exports.configure = function configure(options, logDir) {
  options = options || {};

  let level = log.INFO;
  switch (options.verbose) {
    case 1:
      level = log.DEBUG;
      break;
    case 2:
      level = log.VERBOSE;
      break;
    case 3:
      level = log.TRACE;
      break;
    default:
      break;
  }

  if (options.silent) {
    level = log.NONE;
  }

  log.basicConfig({
    'format': '[%(date)s] %(levelname)s: %(message)s',
    'level': level
  });

  log.addHandler(new log.handlers.File(
    {
      file: logDir + '/sitespeed.io.log',
      formatter: new log.Formatter({
        'format': '[%(date)s] %(levelname)s: %(message)s',
        'level': level
      })
    }
    ));
};

{'fraction_non_alphanumeric': 0.1608876560332871, 'fraction_numerical': 0.006934812760055479, 'mean_word_length': 2.4113475177304964, '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': '4505515', 'n_tokens_mistral': 518, 'n_tokens_neox': 495, 'n_words': 115}