Created
June 10, 2013 14:34
-
-
Save xsurge83/5749166 to your computer and use it in GitHub Desktop.
trace
This file contains hidden or 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
exports.trace = function(label) { | |
// TODO probably can to do this better with V8's debug object once that is | |
// exposed. | |
var err = new Error; | |
err.name = 'Trace'; | |
err.message = label || ''; | |
Error.captureStackTrace(err, arguments.callee); | |
console.error(err.stack); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment