<commit_before>'use strict';

const path = require('path');

const async = require('async');

const merge = require(path.join(__dirname, 'merge'));

function index(env, callback) {
  if (!env.config.environments) {
    return callback(new Error('environments must be defined.'));
  }

  const environment = env.config.environments[env.mode] || {};

  merge(env.config, environment);

  async.forEachSeries(environment.plugins, (plugin, callback) => {
    env.loadPluginModule(plugin, callback);
  }, callback);
}

module.exports = index;<commit_msg>Add logger messages<commit_after>'use strict';

const path = require('path');

const async = require('async');

const merge = require(path.join(__dirname, 'merge'));

function index(env, callback) {
  if (!env.config.environments) {
    return callback(new Error('environments must be defined.'));
  }

  const environment = env.config.environments[env.mode] || {};

  env.logger.verbose(`patching environment - mode: ${env.mode}`);
  merge(env.config, environment);
  env.logger.verbose('new config:', env.config);

  async.forEachSeries(environment.plugins, (plugin, callback) => {
    env.logger.verbose(`loading new plugin: ${plugin}`);
    env.loadPluginModule(plugin, callback);
  }, callback);
}

module.exports = index;
{'fraction_non_alphanumeric': 0.1614420062695925, 'fraction_numerical': 0.0, 'mean_word_length': 5.080952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1816411', 'n_tokens_mistral': 377, 'n_tokens_neox': 371, 'n_words': 84}