1.2.1 โ€ข Published 2 years ago

emoji-logs v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

emoji-logs

Emoji-logs is a zero-dependency module that marks certain console logs with emoji.

Install

npm install emoji-logs
yarn add emoji-logs

Usage

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({})

Config

Change emoji

require('emoji-logs').config({
  info: '๐Ÿงถ', 
  debug: '๐Ÿ”ง', 
  warn: '๐Ÿ”ฅ', 
  error: '๐Ÿ’ฅ',
})

Change Formatter

const moment = require('moment')

require('emoji-logs').config({
  formatter: (v) => {
    const time = moment(new Date()).format('HH:MM:SS')
    return `[${time}] ${v}>`
  }
})

Example

Default configuration

example

Changed emojis

example

Changed formatter

example

1.2.0

2 years ago

1.1.4

2 years ago

1.2.1

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago