当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Node.js Console.trace([message][, ...args])用法及代码示例

console.trace([message][, ...args])

添加于:v0.1.104

参数

将字符串 'Trace: ' 打印到 stderr ,后跟 util.format() 格式化消息和堆栈跟踪到代码中的当前位置。

console.trace('Show me');
// Prints: (stack trace will vary based on where trace is called)
//  Trace: Show me
//    at repl:2:9
//    at REPLServer.defaultEval (repl.js:248:27)
//    at bound (domain.js:287:14)
//    at REPLServer.runBound [as eval] (domain.js:300:12)
//    at REPLServer.<anonymous> (repl.js:412:12)
//    at emitOne (events.js:82:20)
//    at REPLServer.emit (events.js:169:7)
//    at REPLServer.Interface._onLine (readline.js:210:10)
//    at REPLServer.Interface._line (readline.js:549:8)
//    at REPLServer.Interface._ttyWrite (readline.js:826:14)

相关用法


注:本文由纯净天空筛选整理自nodejs.org大神的英文原创作品 Console.trace([message][, ...args])。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。