<commit_before>//A logger wrapper that handles logging to the groundstation, the console, and the filesystem
//There are 5 levels of logs: error, warn, info, and debug, and data
//error and warning level are saved to the error log, debug and info are saved to the debug log, and everything is stored in the "all" log
//data is stored in its own data file so as not to spam the other logs

var fs=require('fs');
var mkdirp = require('mkdirp');
var app_config=require('../../config/application-config');
var util = require('util');
var EventEmitter = require('events');
var advanced_config=require('../../config/advanced-config');

var date=new Date();
var string_date=date.toDateString() + ' ' + date.toLocaleTimeString(); //output format is like: "Thu Dec 24 2015 2:33:20 AM"

//create the logs directory if it doesnt yet exist
mkdirp.sync(app_config.get('log_dir'));

var all_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s/g, "-")+'-all' + ".log");
var debug_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s/g, "-")+'-debug' + ".log");
var error_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s/g, "-")+'-error' + ".log");
var data_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s/g, "-")+'-data' + ".log"); //writes whatever we received from the groundstation


var Logger=function(){
 	// Initialize necessary properties from `EventEmitter` in this instance
	EventEmitter.call(this);

	var getStringDate=function(){
		var date=new Date();
		return date.toDateString() + ' ' + date.toLocaleTimeString();
	};
	var writeDebugFile=function(text) {
      debug_log.write(text.trim() + "\r\n");
      all_log.write(text.trim() + "\r\n");
    };
    var writeErrorFile=function(text) {<commit_msg>Fixed logger error<commit_after>//A logger wrapper that handles logging to the groundstation, the console, and the filesystem
//There are 5 levels of logs: error, warn, info, and debug, and data
//error and warning level are saved to the error log, debug and info are saved to the debug log, and everything is stored in the "all" log
//data is stored in its own data file so as not to spam the other logs

var fs=require('fs');
var mkdirp = require('mkdirp');
var app_config=require('../../config/application-config');
var util = require('util');
var EventEmitter = require('events');
var advanced_config=require('../../config/advanced-config');

var date=new Date();
var string_date=date.toDateString() + ' ' + date.toLocaleTimeString(); //output format is like: "Thu Dec 24 2015 2:33:20 AM"

//create the logs directory if it doesnt yet exist
mkdirp.sync(app_config.get('log_dir'));

var all_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s|:/g, "-")+'-all' + ".log");
var debug_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s|:/g, "-")+'-debug' + ".log");
var error_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s|:/g, "-")+'-error' + ".log");
var data_log = fs.createWriteStream(app_config.get('log_dir')+"GCS-" + string_date.replace(/\s|:/g, "-")+'-data' + ".log"); //writes whatever we received from the groundstation

var Logger=function(){
 	// Initialize necessary properties from `EventEmitter` in this instance
	EventEmitter.call(this);

	var getStringDate=function(){
		var date=new Date();
		return date.toDateString() + ' ' + date.toLocaleTimeString();
	};
	var writeDebugFile=function(text) {
      debug_log.write(text.trim() + "\r\n");
      all_log.write(text.trim() + "\r\n");
    };
    var writeErrorFile=function(text) {
{'fraction_non_alphanumeric': 0.16928069226608977, 'fraction_numerical': 0.006489994591671174, 'mean_word_length': 4.726006191950464, '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': '7175911', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1166, 'n_words': 340}