id.log
id.log is a Node.JS module, alternative to console.log, with some powerful features !
Install
npm install id.log --save
Usage
const id = ;id;// => 2017-10-28 10:48:37 - Hello dudes !
isDev() : set your current environment
You can play with isDev, like electron-is-dev :
id;id;// No output in prod env id;id;// => 2017-10-28 10:48:37 - Dev env Hell YEAH
Or like this :
ifprocessenvNODE_ENV === 'production' id;id;
You can edit all the arguments by passing an object to id()
:
Setup all options
The better way to do it :
const args = id: 'goodid' date: true separator: '🦄' quietMode: false priority: 9 // all messages > 9 are displayed; ; id;// Goodid 🦄 2017-10-28 10:48:37 🦄 Dev env Hell YEAH
You can change everything :
- id: not used by default, but useful for socket instances
- date: true, by default, but you can set it to false
- separator: default to
'-'
, but you can use a beautiful unicorn emoji'🦄'
- quietMode: false by default, you can handle it with
isDev()
, or set it with the main way. As YOU want ! - priority: set a minimum indicator for the quiet mode. By default, you set the priority on 5. This mean, if you send this log
id.log('message', 4)
, we don't display it.
Licence
CC-BY-NC-SA-4.0 - Arthur Lacoste