src/nopg.js
function _log_time(sample) {

	debug.assert(sample).is('object');
	debug.assert(sample.event).is('string');
	debug.assert(sample.start).is('date');
	debug.assert(sample.end).is('date');
	debug.assert(sample.duration).ignore(undefined).is('number');
	debug.assert(sample.query).ignore(undefined).is('string');
	debug.assert(sample.params).ignore(undefined).is('array');

	var msg = 'NoPg event ' + sample.event + ' in ' + sample.duration + ' ms';
	if(sample.query || sample.params) {
		msg += ': ';
	}
	if(sample.query) {
		msg += 'query=' + util.inspect(sample.query);
		if(sample.params) {
			msg += ', ';
		}
	}
	if(sample.params) {
		msg += 'params=' + util.inspect(sample.params);
	}
	debug.log(msg);

}
function _log_time(sample) {

	debug.assert(sample).is('object');
	debug.assert(sample.event).is('string');
	debug.assert(sample.start).is('date');
	debug.assert(sample.end).is('date');
	debug.assert(sample.duration).ignore(undefined).is('number');
	debug.assert(sample.query).ignore(undefined).is('string');
	debug.assert(sample.params).ignore(undefined).is('array');

	var msg = 'NoPg event ' + sample.event + ' in ' + sample.duration + ' ms';
	if(sample.query || sample.params) {
		msg += ': ';
	}
	if(sample.query) {
		msg += 'query=' + util.inspect(sample.query);
		if(sample.params) {
			msg += ', ';
		}
	}
	if(sample.params) {
		msg += 'params=' + util.inspect(sample.params);
	}
	debug.log(msg);

}
function _log_time ( sample ) { debug . assert ( sample ) . is ( 'object' ) ; debug . assert ( sample . event ) . is ( 'string' ) ; debug . assert ( sample . start ) . is ( 'date' ) ; debug . assert ( sample . end ) . is ( 'date' ) ; debug . assert ( sample . duration ) . ignore ( undefined ) . is ( 'number' ) ; debug . assert ( sample . query ) . ignore ( undefined ) . is ( 'string' ) ; debug . assert ( sample . params ) . ignore ( undefined ) . is ( 'array' ) ; var msg = 'NoPg event ' + sample . event + ' in ' + sample . duration + ' ms' ; if ( sample . query || sample . params ) { msg += ': ' ; } if ( sample . query ) { msg += 'query=' + util . inspect ( sample . query ) ; if ( sample . params ) { msg += ', ' ; } } if ( sample . params ) { msg += 'params=' + util . inspect ( sample . params ) ; } debug . log ( msg ) ; }
Optionally log time
Optionally log time