• message {any}
    • ...args {any}

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

    1. console.trace('展示');
    2. // 打印: (堆栈跟踪将根据调用跟踪的位置而有所不同)
    3. // Trace: 展示
    4. // at repl:2:9
    5. // at REPLServer.defaultEval (repl.js:248:27)
    6. // at bound (domain.js:287:14)
    7. // at REPLServer.runBound [as eval] (domain.js:300:12)
    8. // at REPLServer.<anonymous> (repl.js:412:12)
    9. // at emitOne (events.js:82:20)
    10. // at REPLServer.emit (events.js:169:7)
    11. // at REPLServer.Interface._onLine (readline.js:210:10)
    12. // at REPLServer.Interface._line (readline.js:549:8)
    13. // at REPLServer.Interface._ttyWrite (readline.js:826:14)