<commit_before>var async = require('async'),
    events = require('events');

exports.Monitor = function () {
    var self = this;

    self.plugins = [];
    self.currentBuilds = [];

    self.extendWith = function (plugin) {
        self.plugins.push(plugin);
    };

    self.run = function () {
        var results = [];

        async.each(self.plugins, function (plugin, pluginCallback) {
            plugin.check(function (result) {
                for (var i = 0; i < result.length; i++) {
                    results.push(result[i]);
                };

                pluginCallback();
            });
        },
        function (error) {
            self.currentBuilds = results;
            self.emit('update', results);

            setTimeout(self.run, 5000);
        });<commit_msg>Added logging.<commit_after>var async = require('async'),
    events = require('events');

var log = function (text) {
    console.log(new Date().toLocaleTimeString(), '|', text);
};

exports.Monitor = function () {
    var self = this;

    self.plugins = [];
    self.currentBuilds = [];

    self.extendWith = function (plugin) {
        self.plugins.push(plugin);
    };

    self.run = function () {
        var results = [];

        async.each(self.plugins, function (plugin, pluginCallback) {
            log('Check for builds...');

            plugin.check(function (result) {
                for (var i = 0; i < result.length; i++) {
                    results.push(result[i]);
                };

                pluginCallback();
            });
        },
        function (error) {
            log(results.length + ' builds found....');

            self.currentBuilds = results;
            self.emit('update', results);

            setTimeout(self.run, 5000);
        });
{'fraction_non_alphanumeric': 0.14868641699273338, 'fraction_numerical': 0.005589714924538848, 'mean_word_length': 1.7245053272450532, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1402186', 'n_tokens_mistral': 499, 'n_tokens_neox': 468, 'n_words': 100}