12 lines
518 B
JavaScript
12 lines
518 B
JavaScript
const colors = require('colors')
|
|
|
|
module.exports = {
|
|
info: (msg) => console.log(`${colors.cyan(`[${new Date().toISOString()}] INFO:`)} ${msg}`),
|
|
warn: (msg) => console.log(`${colors.yellow(`[${new Date().toISOString()}] WARN:`)} ${msg}`),
|
|
error: (msg) => console.log(`${colors.red(`[${new Date().toISOString()}] ERROR:`)} ${msg}`),
|
|
debug: (msg) => {
|
|
if (process.env.DEBUG && process.env.DEBUG.toLowerCase() === "true") {
|
|
console.log(`${colors.magenta(`[${new Date().toISOString()}] DEBUG:`)} ${msg}`)
|
|
}
|
|
}
|
|
} |