lib/misc/utils.js
/**
 * @method make_debugLog
 * @param script_fullpath
 * @return returns a  debugLog function that will write message to the console
 * if the DEBUG environment variable indicates that the provided source file shall display debug trace
 *
 */
@method make_debugLog
@param script_fullpath
@return returns a  debugLog function that will write message to the console
if the DEBUG environment variable indicates that the provided source file shall display debug trace
@method make_debugLog @param script_fullpath @return returns a debugLog function that will write message to the console if the DEBUG environment variable indicates that the provided source file shall display debug trace
function make_debugLog(script_fullpath) {
    function w(str,l) {
        return (str+"                                    ").substr(0,l);
    }
    function file_line(filename,caller_line) {
        return (w(filename,30)+ ":" + w(caller_line,5)).bgWhite.cyan;
    }
    var doDebug = checkDebugFlag(script_fullpath);
    var filename = path.basename(script_fullpath, ".js");
    function debugLogFunc() {
        if (debug_flags[filename] ) {
            var l = (new Error()).stack.split("\n")[2].split(":");
            var caller_line = l[l.length-2];
            var args = [].concat([file_line(filename,caller_line)]  ,_.values(arguments)           );
            console.log.apply(console, args);
        }
    }
    return debugLogFunc;
}
function make_debugLog ( script_fullpath ) { function w ( str , l ) { return ( str + "                                    " ) . substr ( 0 , l ) ; } function file_line ( filename , caller_line ) { return ( w ( filename , 30 ) + ":" + w ( caller_line , 5 ) ) . bgWhite . cyan ; } var doDebug = checkDebugFlag ( script_fullpath ) ; var filename = path . basename ( script_fullpath , ".js" ) ; function debugLogFunc ( ) { if ( debug_flags [ filename ] ) { var l = ( new Error ( ) ) . stack . split ( "\n" ) [ 2 ] . split ( ":" ) ; var caller_line = l [ l . length - 2 ] ; var args = [ ] . concat ( [ file_line ( filename , caller_line ) ] , _ . values ( arguments ) ) ; console . log . apply ( console , args ) ; } } return debugLogFunc ; }
@method make_debugLog
 @param script_fullpath
 @return returns a  debugLog function that will write message to the console
 if the DEBUG environment variable indicates that the provided source file shall display debug trace
@method make_debugLog @param script_fullpath @return returns a debugLog function that will write message to the console if the DEBUG environment variable indicates that the provided source file shall display debug trace
// caller line number