Emoji-logs is a zero-dependency module that marks certain console logs with emoji.
npm install emoji-logs
yarn add emoji-logs
As early as possible in your application, require and configure emoji-logs.
// CommonJS
require('emoji-logs').config({})
// JavaScript modules
import emojiLogs from 'emoji-logs'
emojiLogs.configure({})
require('emoji-logs').config({
info: '🧶',
debug: '🔧',
warn: '🔥',
error: '💥',
})
const moment = require('moment')
require('emoji-logs').config({
formatter: (v) => {
const time = moment(new Date()).format('HH:MM:SS')
return `[${time}] ${v}>`
}
})