Tuesday 2 October 2018

node.js: console.trace([message][, ...args]): Log the stack trace

console.trace([message][, ...args])
print the log message followed by stack trace.

HelloWorld.js
console.trace("Hello World");

Output
Trace: Hello World
    at Object.<anonymous> (C:\Users\krishna\Documents\nodejs\examples\HelloWorld.js:1:71)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)


Previous                                                 Next                                                 Home

No comments:

Post a Comment