<commit_before>var Emitter = require('../emitter')
var emit = Emitter.prototype.emit

module.exports = new Emitter({
    $define: {
      $plugins: { value: {} },
      //extraStuff can be id, value, more!
      emit: function(event, bind, force, meta, extraStuff) {

          for( var service in this.$plugins ) {
            console.log( '%chey got this plugins! have to send to some service', 'color:purple;font-weight:bold;' ,
              '\nto this SERVICE:', service, '\n', meta.$path, extraStuff
            )
          }

          //GA.call
          //Omni call
          //vigour rick tracking service

          console.log('omg omg omg wtf wtf wtf')

      }
    }
})<commit_msg>added tracking<commit_after>"use strict";

var Emitter = require('../emitter')
var Datalayer = require('./datalayer')

module.exports = new Emitter({
  $flags: {
    $services:function( val ) {
      for(var i in val) {
        this.$services[i] = val[i]
      }
    }
  },
  $define: {
    $services: { value: {} },
    $emitterKeys: {
      value: {
        $error: function( data, event, bind, force, key, observable, meta, id ) {
          data.eventobject.metaMessage = meta.message
        }
      }
    },
    $parseInput: function( event, bind, force, key, observable, meta, id) {

      console.error(id)

      var data = new Datalayer({
        id: id,
        eventobject: {
          stamp: event.$stamp,
          eventType: event.$type,
          eventOriginator: event.$origin
        }
      })

      if(this.$emitterKeys[key]) {
        this.$emitterKeys[key].call(this, data, event, bind, force, key, observable, meta, id )
      }

      console.log('here you do parsing of stuff that you want to send to your service')
      return data
    },
    emit: function() {
      console.log('--->', arguments)
      var parsed = this.$parseInput.apply( this, arguments )
      for( var service in this.$services )
      {
        this.$services[service]( parsed )
      }
    }
  }
})
{'fraction_non_alphanumeric': 0.1393483709273183, 'fraction_numerical': 0.0, 'mean_word_length': 2.051987767584098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2191047', 'n_tokens_mistral': 626, 'n_tokens_neox': 605, 'n_words': 164}