var log = false;
console.log(log, "doesn't log to console");
log = true;
console.log(log, "does log to console");
...
var headerLogging = false;
var footerLogging = true;
function headerCode() {
// do stuff
console.log(headerLogging, "someObj",someObj);
// do more stuff
console.log(headerLogging, "anotherObj",anotherObj);
}
function footerCode() {
// do stuff
console.log(footerLogging, "someObj",someObj);
// do more stuff
console.log(footerLogging, "anotherObj",anotherObj);
}
would b extremely helpful, instead of having to comment out "console.log()" lines in my code.
or is there an existing/better way of doing this?