<commit_before>var http = require('http');
var express = require('express');
var server = express();
var configUtils = require('./lib/configUtils');

server.use(express.static(__dirname));

var port = process.env.PORT || 1337;
server.listen(port, function() {
    console.log('listening on port ' + port);
    //var err = new Error('This error won't break the application...')
    //throw err
});

var timeFormatter = function () {
    return new Date().toString() + ": ";
};

if(!process.env.configLoaded){
	configUtils.load();
  var execFile = require('child_process').exec;
  var cmd = "\"./node_modules/.bin/grunt\" browserify:example";
  execFile(cmd, function(error, stdout, stderr) {
      configUtils.save(timeFormatter() + stdout, './logsOut.txt');
      configUtils.save(timeFormatter() + stderr, './logsErr.txt');
    if (error != null) {
        configUtils.save('exec error: ' + timeFormatter() + error, './Error.txt');
    }
    process.env.configLoaded = true;
  });
}<commit_msg>Adding logging<commit_after>var http = require('http');
var express = require('express');
var server = express();
var configUtils = require('./lib/configUtils');

server.use(express.static(__dirname));

var port = process.env.PORT || 1337;
server.listen(port, function() {
    console.log('listening on port ' + port);
    //var err = new Error('This error won't break the application...')
    //throw err
});

var timeFormatter = function () {
    return new Date().toString() + ": ";
};

if(!process.env.configLoaded){
	configUtils.load();
  var execFile = require('child_process').exec;
  var cmd = "\"./node_modules/.bin/grunt\" browserify:example";
  execFile(cmd, function(error, stdout, stderr) {
      configUtils.save(timeFormatter() + stdout, './info.log');
      configUtils.save(timeFormatter() + stderr, './error.log');
    if (error != null) {
        configUtils.save('exec error: ' + timeFormatter() + error, './error.log');
    }
    process.env.configLoaded = true;
  });
}
{'fraction_non_alphanumeric': 0.1822759315206445, 'fraction_numerical': 0.004028197381671702, 'mean_word_length': 3.8700980392156863, 'pattern_counts': {'":': 2, '<': 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': '1288944', 'n_tokens_mistral': 611, 'n_tokens_neox': 600, 'n_words': 139}