<commit_before>'use strict';
const merge = require('lodash.merge');

const CONFIG_OVERRIDE_PATH = './config-override.js';

const DEFAULT_GRAMMAR_PATH = './src/data/grammar.json';
const TWEET_LENGTH = 140;
const TEMPFILE_PATH = '/tmp';
const LOGFILE_PATH = `./debug.log`;

let config = {
	defaultGrammarPath:  DEFAULT_GRAMMAR_PATH,
	defaultGrammar: undefined,
	tweetLength: TWEET_LENGTH,
	paths: {
		tempDirectory: TEMPFILE_PATH,
		logFile: LOGFILE_PATH
	}
};

// apply overrides from config overrides file
let override;
try { override = require(CONFIG_OVERRIDE_PATH); } catch(e) { console.log('override file not found: ' + e); }
config = merge(config, override);

// load the default grammar after applying overrides
config.defaultGrammar = require(config.defaultGrammarPath);

config = Object.freeze(config);

global.mtgnewsbot = global.mtgnewsbot || {};
global.mtgnewsbot.config = config;

module.exports =config;<commit_msg>don't log when config override isn't found<commit_after>'use strict';
const merge = require('lodash.merge');

const CONFIG_OVERRIDE_PATH = './config-override.js';

const DEFAULT_GRAMMAR_PATH = './src/data/grammar.json';
const TWEET_LENGTH = 140;
const TEMPFILE_PATH = '/tmp';
const LOGFILE_PATH = `./debug.log`;

let config = {
	defaultGrammarPath:  DEFAULT_GRAMMAR_PATH,
	defaultGrammar: undefined,
	tweetLength: TWEET_LENGTH,
	paths: {
		tempDirectory: TEMPFILE_PATH,
		logFile: LOGFILE_PATH
	}
};

// apply overrides from config overrides file
let override;
try { 
  override = require(CONFIG_OVERRIDE_PATH); 
  console.info('Applying config overrides.');
} catch(e) { 
  /* use default config */ 
}
config = merge(config, override);

// load the default grammar after applying overrides
config.defaultGrammar = require(config.defaultGrammarPath);

config = Object.freeze(config);

global.mtgnewsbot = global.mtgnewsbot || {};
global.mtgnewsbot.config = config;

module.exports =config;
{'fraction_non_alphanumeric': 0.12160751565762004, 'fraction_numerical': 0.003131524008350731, 'mean_word_length': 5.326732673267327, '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': '6452266', 'n_tokens_mistral': 665, 'n_tokens_neox': 631, 'n_words': 146}