Created
December 18, 2013 23:28
-
-
Save markcode/8031673 to your computer and use it in GitHub Desktop.
Logging function for: quiet, benchmarking, debug and dumping.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// logging, dump, function. Can set: gconfig['loggin'] = 'quiet' || 'benchmarking' || 'debug' | |
var log = function(txt, benchmarking, dump) { | |
if ( dump != undefined ) { | |
console.log(txt + ' >> ' + require('util').inspect(dump, true, 99, true)); | |
} else if ( gconfig['loging'] === 'benchmarking' ) { | |
if ( benchmarking === true ) { | |
console.log(txt); | |
} | |
} else if ( gconfig['loging'] === 'debug' ) { | |
console.log(txt); | |
} else if ( gconfig['loging'] === 'quiet' ) { | |
// only if throw errors. | |
} | |
}; | |
var log = function(txt, benchmarking, dump) { if ( dump != undefined ) { console.log(txt + ' >> ' + require('util').inspect(dump, true, 99, true)); } else if ( gconfig['loging'] === 'benchmarking' ) { if ( benchmarking === true ) { console.log(txt); } } else if ( gconfig['loging'] === 'debug' ) { console.log(txt); } else if ( gconfig['loging'] === 'quiet' ) { } }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment