17 lines
385 B
JavaScript
17 lines
385 B
JavaScript
const environment = process.env.NODE_ENV;
|
|
|
|
const hideInProduction = ['info', 'dbug'];
|
|
|
|
async function out(msg, level = 'othr') {
|
|
if (environment === 'production' &&
|
|
hideInProduction.includes(level.toLowerCase())) {
|
|
return;
|
|
} else {
|
|
const time = new Date().toISOString();
|
|
console.log(`${time} - ${level.toUpperCase()} - ${msg}`);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
out
|
|
}; |