lib/logger/Logger.js
function logTypeToString(logType) {
	var logTypeString;
	if (logType instanceof RegExp) {
		logTypeString = logType.source;
	} else if (typeof (logType) === 'string') {
		logTypeString = '^' + JSUtils.escapeRegExp(logType) + '$';
	} else {
		throw new Error('logType is neither a regular expression nor a string.');
	}
	return logTypeString;
}
function logTypeToString(logType) {
	var logTypeString;
	if (logType instanceof RegExp) {
		logTypeString = logType.source;
	} else if (typeof (logType) === 'string') {
		logTypeString = '^' + JSUtils.escapeRegExp(logType) + '$';
	} else {
		throw new Error('logType is neither a regular expression nor a string.');
	}
	return logTypeString;
}
function logTypeToString ( logType ) { var logTypeString ; if ( logType instanceof RegExp ) { logTypeString = logType . source ; } else if ( typeof ( logType ) === 'string' ) { logTypeString = '^' + JSUtils . escapeRegExp ( logType ) + '$' ; } else { throw new Error ( 'logType is neither a regular expression nor a string.' ) ; } return logTypeString ; }
Convert logType into a source string for a regExp that we can
subsequently use to test logTypes passed in from Logger.log.
@param {RegExp} logType
@return {string}
@private
Convert logType into a source string for a regExp that we can subsequently use to test logTypes passed in from Logger . log .