开发者

Difference in blocking between sys.log() and console.log() and console.error()?

  1. Is any one of sys.log(), console.log(), console.error() blocking? (var sys = require("sys");)
  2. How is sys.log() d开发者_Go百科ifferent from console.log();


console.error is blocking (it calls sync write in writeError).

console.log is non-blocking = process.stdout.write(util.format.apply(this, arguments) + '\n');

sys.log == util.log == puts(timestamp() + ' - ' + msg.toString()); (non-blocking)


From Firebug Wiki:

console.log writes a message to the console. You may pass as many arguments as you'd like, and they will be joined together in a space-delimited line.

console.error writes a message to the console with the visual "error" icon and color coding and a hyperlink to the line where it was called.

AFAIK they are not blocking.

sys.log is not native in the browsers I use. Maybe you can provide more info on that.

UPDATE: just noticed your node.js tag... Anyhow, I still don't think any of them is blocking.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜