T
T
Test2017-07-16 08:25:02
Node.js
Test, 2017-07-16 08:25:02

How to disable output to the console?

There is one module that uses the console too much while working. I would like it to do its work more quietly, and the possibility of accurate logging was left only to me. Can I somehow temporarily disable the output to the console, and then return it back?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Fayzullin, 2017-07-16
@ernesto77

can be overriddenconsole.log

let debug = 1;
let logger = function(a,b) { if ( debug == 1 ) console.log(a, b || "")};

logger("my", "log");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question