Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambdacasserole/log-color-plusplus.js
Enhanced color-enabled logging library.
https://github.com/lambdacasserole/log-color-plusplus.js
Last synced: 12 days ago
JSON representation
Enhanced color-enabled logging library.
- Host: GitHub
- URL: https://github.com/lambdacasserole/log-color-plusplus.js
- Owner: lambdacasserole
- License: mit
- Created: 2016-06-06T16:28:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-06T19:18:12.000Z (over 8 years ago)
- Last Synced: 2024-10-26T02:59:39.156Z (18 days ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Log.js (with added vitamins for pep and vigor)
This package is based on [log-color-optionaldate.js](https://github.com/lambdacasserole/log-color-optionaldate.js) which is a fork of [log-color.js](https://github.com/futoase/log-color.js) which it itself a fork of [Log.js](https://github.com/tj/log.js).
## Installation
Install using [npm](https://www.npmjs.com/):
```
$ npm install log-color-plusplus
```## Example
Can be used in a similar fashion to [Log.js](https://github.com/tj/log.js).
Code snippet:
```
var Log = require('log');
var log = new Log('info');
log.info('Sent a message to the [email protected]');
```### Enabling Color/Wrapping
Enable color/wrapping like this:
```
var Log = require('log-color-plusplus');
var log = new Log({
level: 'debug',
color: true,
date: false,
wrap: true, // Turn word wrap on.
width: 50 // Wrap at 50 chars.
});
log.warning('Failed to send a message to the [email protected]');
```## Log Levels
The same log levels are available as in [Log.js](https://github.com/tj/log.js), with one addition:
```
log.alert('alert');
log.critical('critical');
log.error('error');
log.warning('warning');
log.notice('notice');
log.info('info');
log.debug('debug');
log.print('print'); // Added. Will print a string without a 'level' preceeding it.
```