Example #1
0
	pubsub.subscribe('log:send',function(){
		var logStack = logStackGetter();
		// get pulse size
		var pulse = settings().logger && settings().logger.pulse;

		// if logStack is full, lets send it
		if (pulse && logStack.length - lastSend >= pulse) {
			sendChunk();
		}
	});
Example #2
0
	pubsub.subscribe('log',function(options, input_data){
		var logStack = logStackGetter();
		// get settings
		var logger = settings().logger || {};
		// get the logger function
		var callback = logger.logger ? logger.logger : defaultLogger;

		// add row to log stack
		var trialObj = trial();
		var row = callback.apply(trialObj,[trialObj.data, input_data, options,logStack]);

		if (logger.meta){
			if ($.isPlainObject(logger.meta)){
				$.extend(row, logger.meta);
			} else {
				throw new Error ('LOGGER: logger.meta must be an object but instead was a ' + typeof logger.meta);
			}
		}

		logStack.push(row);
	});
Example #3
0
				.always(function(){
					var hooks = settingsGetter('hooks') || {};
					return $.when(hooks.endTask && hooks.endTask());
				})