Node v8.5 with --trace-events-enabled not generating a trace log file

I am running node v8.5 and I am trying to play around with an experimental trace function.

Launching my application node --trace-events-enabled app.jsI expect to see the trace log file generated in the node documentation here https://nodejs.org/api/tracing.html , which I can view in chrome by visiting chrome://tracingand downloading the generated trace log file.

However, it looks like node is not creating this log file at all. Are there any options that I am missing, or a log file saved outside my project directory?

+4
source share
1 answer

node v8.9.1, , app.js.

: node_trace.1.log , node (node --trace-events-enabled ./bin/trace-me.js ./):

console.log("Trace me");

const interv = setInterval(()=>console.log("Runnning"), 1000);

// quit on ctrl-c when running docker in terminal
process.on('SIGINT', function onSigint() {
    console.info('Got SIGINT (aka ctrl-c). Graceful shutdown ', new Date().toISOString());
    clearInterval(interv);
});

process.on('beforeExit', function (exitCode) {
   console.log("Before exit: "+ exitCode);
});

ctrl-c , , beforeExit .

, process.exit():

, , , - process.stdout process.stderr. .

, SIGINT SIGTERM , beforeExit, , Node.js .

+1

Source: https://habr.com/ru/post/1686503/


All Articles