Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "pino", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "fast and simple logger", | ||
@@ -5,0 +5,0 @@ "main": "pino.js", |
@@ -13,2 +13,3 @@ # pino | ||
* [How do I rotate log files?](#rotate) | ||
* [How to use Transports with Pino](#transports) | ||
* [Acknowledgements](#acknowledgements) | ||
@@ -303,2 +304,34 @@ * [License](#license) | ||
<a name="transports"></a> | ||
## How to use Transports with Pino | ||
Transports are not part of Pino. There will never be an API for transports, | ||
or support for ObjectMode Writable streams. | ||
This library is fast because it does way less than the others. We went | ||
to great lengths to make sure this library is _really fast_, and transports | ||
will slow things down. | ||
So, how do you do a transport? With Pino, we create a separate process for our transport and pipe to it. | ||
It's the Unix philosophy. | ||
Something like: | ||
```js | ||
var split = require('split2') | ||
var pump = require('pump') | ||
var through = require('through2') | ||
var myTransport = through.obj(function (chunk, enc, cb) { | ||
// do whatever you want here! | ||
console.log(chunk) | ||
cb() | ||
} | ||
pump(process.stdin, split2(JSON.parse), myTransport) | ||
``` | ||
Using transports in the same process causes unnecessary load and slows down Node's single threaded event loop. | ||
If you write a transport, let us know and we will add a link here! | ||
<a name="acknowledgements"></a> | ||
@@ -305,0 +338,0 @@ ## Acknowledgements |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
430438
343