diff --git a/src/utils/log.utils.js b/src/utils/log.utils.js index de25c66..8a67762 100644 --- a/src/utils/log.utils.js +++ b/src/utils/log.utils.js @@ -1,6 +1,12 @@ -async function out(msg) { - var time = new Date().toISOString(); - console.log(`${time} - ${msg}`) +const environment = process.env.NODE_ENV; + +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 = {