When in prod mode, only log timers an errors

This commit is contained in:
Fred Boniface 2023-03-30 20:37:26 +01:00
parent a80c9c632b
commit b5571c2eb2

View File

@ -38,6 +38,10 @@ const delay = ms => new Promise(res => setTimeout(res, ms));
implementation of log helper */ implementation of log helper */
async function log(msg, type) { async function log(msg, type) {
var time = new Date().toISOString(); var time = new Date().toISOString();
const mode = "prod"
if (mode === "prod" && type != "ERR") {
return;
}
switch (type) { switch (type) {
case "ERR": case "ERR":
console.error(`${time} - ${msg}`); console.error(`${time} - ${msg}`);