index.js
function buildMessageBuilder(section) {

	const logOptions = process.env.X2_LOG || '';

	const msgBuilder = new Array();

	if (!/(^|,)nots(,|$)/i.test(logOptions))
		msgBuilder.push(() => (new Date()).toISOString());

	if (!/(^|,)nopid(,|$)/i.test(logOptions))
		msgBuilder.push(() => String(process.pid));

	let m;
	const envRE = new RegExp('(?:^|,)env:([^,]+)', 'gi');
	while ((m = envRE.exec(logOptions)) !== null) {
		const envName = m[1];
		msgBuilder.push(() => process.env[envName]);
	}

	if (section && !/(^|,)nosec(,|$)/i.test(logOptions))
		msgBuilder.push(() => section);

	return msgBuilder;
}
function buildMessageBuilder(section) {

	const logOptions = process.env.X2_LOG || '';

	const msgBuilder = new Array();

	if (!/(^|,)nots(,|$)/i.test(logOptions))
		msgBuilder.push(() => (new Date()).toISOString());

	if (!/(^|,)nopid(,|$)/i.test(logOptions))
		msgBuilder.push(() => String(process.pid));

	let m;
	const envRE = new RegExp('(?:^|,)env:([^,]+)', 'gi');
	while ((m = envRE.exec(logOptions)) !== null) {
		const envName = m[1];
		msgBuilder.push(() => process.env[envName]);
	}

	if (section && !/(^|,)nosec(,|$)/i.test(logOptions))
		msgBuilder.push(() => section);

	return msgBuilder;
}
function buildMessageBuilder ( section ) { const logOptions = process . env . X2_LOG || '' ; const msgBuilder = new Array ( ) ; if ( ! / (^|,)nots(,|$) / i . test ( logOptions ) ) msgBuilder . push ( ( ) => ( new Date ( ) ) . toISOString ( ) ) ; if ( ! / (^|,)nopid(,|$) / i . test ( logOptions ) ) msgBuilder . push ( ( ) => String ( process . pid ) ) ; let m ; const envRE = new RegExp ( '(?:^|,)env:([^,]+)' , 'gi' ) ; while ( ( m = envRE . exec ( logOptions ) ) !== null ) { const envName = m [ 1 ] ; msgBuilder . push ( ( ) => process . env [ envName ] ) ; } if ( section && ! / (^|,)nosec(,|$) / i . test ( logOptions ) ) msgBuilder . push ( ( ) => section ) ; return msgBuilder ; }
Build message build functions list.

@private
@param {string} [section] Debug log section, nothing if error log.
@returns {Array.<function>} Message builder functions.
Build message build functions list .