forked from embee/woomy
23 lines
827 B
JavaScript
23 lines
827 B
JavaScript
'use strict'
|
|
|
|
const { colorConsole } = require('tracer')
|
|
const colors = require('colors')
|
|
|
|
const logger = colorConsole({
|
|
format: [
|
|
'{{timestamp}} | {{title}} | {{file}} | {{message}}',
|
|
{
|
|
debug: `{{timestamp}} | ${'{{title}}'.magenta} | {{file}} | {{message}}`,
|
|
cmd: `{{timestamp}} | ${'{{title}}'.white} | {{file}} | {{message}}`,
|
|
info: `{{timestamp}} | ${'{{title}}'.cyan} | {{file}} | {{message}}`,
|
|
ready: `{{timestamp}} | ${'{{title}}'.green} | {{file}} | {{message}}`,
|
|
warn: `{{timestamp}} | ${'{{title}}'.yellow} | {{file}} | {{message}}`,
|
|
error: `{{timestamp}} | ${'{{title}}'.red} | {{file}} | {{message}}`
|
|
}
|
|
],
|
|
dateformat: 'yyyy-mm-dd"T"HH:MM:ss',
|
|
methods: ['cmd', 'debug', 'info', 'ready', 'warn', 'error'],
|
|
filters: [colors.white]
|
|
})
|
|
|
|
module.exports = logger
|