Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/volt1c/emoji-logs
This is npm package add emoji prefixes to your specified console logs
https://github.com/volt1c/emoji-logs
console console-log debug debugging javascript js log logging logs npm-package package yarn-package
Last synced: 10 days ago
JSON representation
This is npm package add emoji prefixes to your specified console logs
- Host: GitHub
- URL: https://github.com/volt1c/emoji-logs
- Owner: volt1c
- License: mit
- Created: 2021-06-15T20:52:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-03T09:29:48.000Z (almost 3 years ago)
- Last Synced: 2024-11-01T15:03:47.830Z (14 days ago)
- Topics: console, console-log, debug, debugging, javascript, js, log, logging, logs, npm-package, package, yarn-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/emoji-logs
- Size: 110 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# emoji-logs
Emoji-logs is a zero-dependency module that marks certain console logs with emoji.
## Install
```bash
npm install emoji-logs
yarn add emoji-logs
```## Usage
As early as possible in your application, require and configure emoji-logs.
```js
// CommonJS
require('emoji-logs').config({})// JavaScript modules
import emojiLogs from 'emoji-logs'emojiLogs.configure({})
```## Config
### Change emoji
```js
require('emoji-logs').config({
info: '๐งถ',
debug: '๐ง',
warn: '๐ฅ',
error: '๐ฅ',
})
```### Change Formatter
```js
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](./assets/default.gif)
### Changed emojis
![example](./assets/configured.gif)
### Changed formatter
![example](./assets/formatter.gif)