Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Nov 28, 2016
1 parent 0b56336 commit ef13b73
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ It also includes a shell utility to pretty-print its log files.
* [How to use Pino with Hapi](#hapi)
* [How to use Pino with Restify](#restify)
* [How to use Pino with Koa](#koa)
* [How to use Pino with `debug`](#debug)
* [How do I rotate log files?](#rotate)
* [How do I redact sensitive information?](#redact)
* [How to use Transports with Pino](#transports)
Expand Down Expand Up @@ -772,6 +773,31 @@ app.listen(3000)

See the [koa-pino-logger v2 readme](https://github.com/pinojs/koa-pino-logger/tree/v2) for more info.

<a name="debug"></a>
## How to use Pino with `debug`

The popular [`debug`](http://npm.im/debug) which
used in many modules accross the ecosystem.

The [`pino-debug`](http://github.com/pinojs/pino-debug)
can captures calls to the `debug` loggers and run them
through `pino` instead. This results in a 10x (20x in extreme mode)
performance improvement, while logging out more information, in the
usual JSON format.

The quick start way to enable this is simply to install [`pino-debug`](http://github.com/pinojs/pino-debug)
and preload it with the `-r` flag, enabling any `debug` logs with the
`DEBUG` environment variable:

```sh
$ npm i --save pino-debug
$ DEBUG=* node -r pino-debug app.js
```

[`pino-debug`](http://github.com/pinojs/pino-debug) also offers fine grain control to map specific `debug`
namespaces to `pino` log levels. See [`pino-debug`](http://github.com/pinojs/pino-debug)
for more.


<a name="rotate"></a>
## How do I rotate log files?
Expand Down Expand Up @@ -801,6 +827,9 @@ We would rotate our log files with logrotate, by adding the following to `/etc/l
}
```




<a name="redact"></a>
## How do I redact sensitive information??

Expand Down
2 changes: 1 addition & 1 deletion test/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function absentConsoleMethodTest (method, fallback) {

function isFunc (fn) { return typeof fn === 'function' }
function fnName (fn) {
var rx = /^\s*function\s*([^\(]*)/i
var rx = /^\s*function\s*([^(]*)/i
var match = rx.exec(fn)
return match && match[1]
}
Expand Down

0 comments on commit ef13b73

Please sign in to comment.