Add log level (optionally) to log.utils
This commit is contained in:
parent
76c40dbbae
commit
47447088a2
@ -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 = {
|
||||||
|
Loading…
Reference in New Issue
Block a user