Created
August 28, 2012 19:58
-
-
Save bahamas10/3503492 to your computer and use it in GitHub Desktop.
figure out what is trying to write to a stream in node
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
Trace | |
at WriteStream.process.stdout.write (/Users/dave/dev/node-latest/index.js:4:11) | |
at Object.exports.log (console.js:25:18) | |
at Object.keys.forEach.console.(anonymous function) [as log] (/Users/dave/dev/node-latest/node_modules/log-timestamp/index.js:13:14) | |
at defaultCb (/Users/dave/dev/node-latest/node_modules/npm/lib/npm.js:205:16) | |
at Conf.done (/Users/dave/dev/node-latest/node_modules/npm/node_modules/npmconf/npmconf.js:218:15) | |
at Object.oncomplete (fs.js:297:15) | |
undefined | |
... and find out the npm module is firing a default callback because I didn't supply one, that logs to stdout. |
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
/** | |
* overwrite the process.stdout.write function to call console.trace first | |
*/ | |
var a = process.stdout.write; | |
process.stdout.write = function() { | |
console.trace(); | |
a.apply(this, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment