https://github.com/hash-bang/async-chainable-log
Plugin for async-chainable that provides simple logging
https://github.com/hash-bang/async-chainable-log
async-chainable javascript logging
Last synced: 5 months ago
JSON representation
Plugin for async-chainable that provides simple logging
- Host: GitHub
- URL: https://github.com/hash-bang/async-chainable-log
- Owner: hash-bang
- License: mit
- Created: 2016-04-27T00:32:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-25T01:29:56.000Z (over 9 years ago)
- Last Synced: 2025-10-26T19:44:55.794Z (8 months ago)
- Topics: async-chainable, javascript, logging
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
async-chainable-log
===================
Plugin for [async-chainable](https://github.com/hash-bang/async-chainable) that provides simple logging.
var asyncChainable = require('async-chainable');
var asyncChainableLog = require('async-chainable-log');
asyncChainable()
.use(asyncChainableLog)
.log('Waiting 1000ms')
.then(function(next) {
setTimeout(next, 1000);
})
.logDefaults({prefix: '\t\t'})
.log('This will be indented with two tabs')
.end();
API
===
The async-chainable-log API exposes two API calls `log()` and `logDefaults()` the first simply logs and the second takes an object with the following parameters:
| Option | Description |
|--------------------|----------------------------------------------------------------------------------------|
| `callback` | Optional callback function to use for logging. The default is `console.log` |
| `prefix` | Optional prefix to prepend to all logging output before it is passed to the `callback` |
| `suffix` | Optional suffix to append to all logging output before it is passed to the `callback` |