node.js中的console.trace方法使用说明
方法说明:
向标准错误流输出当前的调用栈。
语法:
console.trace(label)
接收参数:
label
例子:
console.trace();
//运行结果:
Trace:
atObject.<anonymous>(/home/byvoid/consoletrace.js:1:71)
atModule._compile(module.js:441:26)
atObject..js(module.js:459:10)
atModule.load(module.js:348:31)
atFunction._load(module.js:308:12)
atArray.0(module.js:479:10)
atEventEmitter._tickCallback(node.js:192:40)
源码:
Console.prototype.trace=function(){
//TODOprobablycantodothisbetterwithV8'sdebugobjectoncethatis
//exposed.
varerr=newError;
err.name='Trace';
err.message=util.format.apply(this,arguments);
Error.captureStackTrace(err,arguments.callee);
this.error(err.stack);
};
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短