<commit_before>#!/usr/bin/env node
'use strict';

var forever = require('forever-monitor');

var mailinProcess = new (forever.Monitor)('cli.js', {
    max: 3,
    minUptime: 10000,
    options: process.argv
});

mailinProcess.on('error', function (err) {
    console.log(err);
});

mailinProcess.on('restart', function () {
    console.log('Mailin restarted.');
});

mailinProcess.on('exit', function () {
    console.log('Mailin exited.');
});

mailinProcess.start();<commit_msg>Use logger<commit_after>#!/usr/bin/env node
'use strict';

var forever = require('forever-monitor');
var logger = require('./lib/logger');

var pkg = require('./package.json');

var mailinProcess = new (forever.Monitor)('cli.js', {
    max: 100,
    minUptime: 10000,
    options: process.argv
});

mailinProcess.on('error', function (err) {
    logger.error('Error caused Mailin to crash.');
    logger.error('Please report this to ' + pkg.bugs.url);
    logger.error(err);
    logger.info();
    logger.info();
});

mailinProcess.on('restart', function () {
    logger.warn('It is likely that an error caused Mailin to crash.');
    logger.warn('Please report this to ' + pkg.bugs.url);
    logger.warn('Mailin restarted.');
    logger.info();
    logger.info();
});

mailinProcess.on('exit', function () {
    logger.info('Mailin stopped.');
});

mailinProcess.start();
{'fraction_non_alphanumeric': 0.1849112426035503, 'fraction_numerical': 0.010355029585798817, 'mean_word_length': 4.011111111111111, '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': '4383665', 'n_tokens_mistral': 460, 'n_tokens_neox': 443, 'n_words': 95}