https://github.com/roziscoding/coloredlog
Simple package to log properly colored messages to proper output streams
https://github.com/roziscoding/coloredlog
Last synced: about 1 year ago
JSON representation
Simple package to log properly colored messages to proper output streams
- Host: GitHub
- URL: https://github.com/roziscoding/coloredlog
- Owner: roziscoding
- Created: 2017-05-21T21:13:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T21:32:57.000Z (almost 9 years ago)
- Last Synced: 2025-02-16T00:23:19.580Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# coloredlog
This is a simple utility to log stuff to console without having to manually color it.
## Why?
Aren't there many log libraries already?
Sure! But I wasn't satisfied by any of them, since they either had too much or too little stuff, so I always ended up copying and pasting the same files over all my projects, untill I finally decided I wanted to be able to `yarn add coloredlog`, and here we are xD
## Usage
Just watch and repeat :P
```js
import {log, info, error, warn} from 'coloredlog';
log('This will be output to console.log with a blue color');
info('This will be output to console.info with a cyan color');
error('This will be output to console.error with a red color');
warn('This will be output to console.warn with a yellow color');
```
## NODE_ENV
If you set `NODE_ENV` environment variable to either `test` or `silent`, this module will shut it's mouth up. Useful for when you're running automated tests and don't want stuff getting in your way.
## Contributing
Com'on, you already know how to do this!
Just PR me, I'll be happy to reveal and merge :D
## TODO
- Integrate [prettyjson](https://www.npmjs.com/package/prettyjson) to format objects, when wanted;
- Support custom colors for each output stream