APP nodejs: prevent logs in the terminal window

0

I created an application in Nodejs with Express, and when I put this application to run (with npm start ), logs appear in the terminal window where I am connected to each page that I access from my routes. Is it to be like that? Is it possible to disable it and should it be disabled?

Logs in the terminal window:

GET /javascripts/jquery/jquery-ui.js 304 32.627 ms - -
GET /javascripts/jquery/datepicker-pt-BR.js 304 32.307 ms - -
GET /javascripts/chartjs/Chart.js 304 32.109 ms - -
    
asked by anonymous 01.08.2017 / 20:15

1 answer

0

You can use the following line of code:

console.log = function(){}

Any call to console.log will be "ignored" from that point

If you want to enable / disable, you can assign console.log to a variable and then recover

Eg:

var log = console.log;
console.log = function(){};//Desativa
console.log = log;//Ativa novamente
    
01.08.2017 / 20:23