<commit_before>#!/usr/bin/env node

var async = require('async'),
	colors = require('cli-color');


function work(job, next) {
	var 
		opts = { interval: 3000, wait: 10*60*1000 },
		lastMessageAt = 0, 
		beat = setInterval(tick, opts.interval),
		finalized = false,
		started = false;


	function startListener() {
		console.log('Job '+job.id+' started.');
		started = true;
	}

	function logListener(log) {
		switch(log.type) {
		case 'info':
			console.log(colors.xterm(39)('⚪ ')+log.message);
			break;
		case 'stream':
			var data = Buffer(log.data);
			// nodejs doesn't expose numbered streams so we have to write them ourselves
			if (log.source == 2) process.stderr.write(data);
			else process.stdout.write(data);
			break;
		default:
			console.log(log);
			break;<commit_msg>Add 'result' log category for logListener<commit_after>#!/usr/bin/env node

var async = require('async'),
	colors = require('cli-color');


function work(job, next) {
	var 
		opts = { interval: 3000, wait: 10*60*1000 },
		lastMessageAt = 0, 
		beat = setInterval(tick, opts.interval),
		finalized = false,
		started = false;


	function startListener() {
		console.log('Job '+job.id+' started.');
		started = true;
	}

	function logListener(log) {
		switch(log.type) {
		case 'info':
			console.log(colors.xterm(39)('⚪ ')+log.message);
			break;
		case 'stream':
			var data = Buffer(log.data);
			// nodejs doesn't expose numbered streams so we have to write them ourselves
			if (log.source == 2) process.stderr.write(data);
			else process.stdout.write(data);
			break;
		case 'result':
			break;
		default:
			console.log(log);
			break;
{'fraction_non_alphanumeric': 0.15365703749231716, 'fraction_numerical': 0.019668100799016593, 'mean_word_length': 3.67816091954023, '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': '1169336', 'n_tokens_mistral': 656, 'n_tokens_neox': 547, 'n_words': 141}