Add log level (optionally) to log.utils

This commit is contained in:
Fred Boniface 2023-03-16 20:22:18 +00:00
parent 76c40dbbae
commit 47447088a2

View File

@ -1,6 +1,12 @@
async function out(msg) { const environment = process.env.NODE_ENV;
var time = new Date().toISOString();
console.log(`${time} - ${msg}`) async function out(msg, level = 'OTHR') {
if (environment === "production" && level === "info") {
return;
} else {
const time = new Date().toISOString();
console.log(`${time} - - ${level.toUpperCase()} - ${msg}`);
}
} }
module.exports = { module.exports = {