Comparing version 1.0.1 to 1.1.0
@@ -27,3 +27,8 @@ 'use strict' | ||
server.register(require('.'), (err) => { | ||
server.register({ | ||
register: require('.').register, | ||
options: { | ||
prettyPrint: process.env.NODE_ENV !== 'production' | ||
} | ||
}, (err) => { | ||
if (err) { | ||
@@ -30,0 +35,0 @@ console.error(err) |
10
index.js
@@ -22,4 +22,12 @@ 'use strict' | ||
const logger = pino(options, options.stream) | ||
let stream = options.stream || process.stdout | ||
if (options.prettyPrint) { | ||
let pretty = pino.pretty() | ||
pretty.pipe(stream) | ||
stream = pretty | ||
} | ||
const logger = pino(options, stream) | ||
// expose logger as 'server.app.logger' | ||
@@ -26,0 +34,0 @@ server.app.logger = logger |
{ | ||
"name": "hapi-pino", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Hapi plugin for the Pino logger ", | ||
@@ -37,4 +37,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"pino": "^2.1.4" | ||
"pino": "^2.2.0" | ||
} | ||
} |
@@ -1,3 +0,4 @@ | ||
# hapi-pino | ||
# hapi-pino [](https://travis-ci.org/mcollina/hapi-pino) | ||
[Hapi](http://hapijs.com) plugin for the [Pino](https://github.com/mcollina/pino) logger. It logs in JSON for easy | ||
@@ -86,2 +87,5 @@ post-processing. | ||
`process.stdout`. | ||
- `[prettyPrint]` - pretty print the logs (same as `node server | | ||
pino`), disable in production. Default is `false`, enable in | ||
development by passing `true`. | ||
- `[tags]` - a map to specify pairs of Hapi log tags and levels. | ||
@@ -88,0 +92,0 @@ - `[allTags]` - the logging level to apply to all tags not matched by |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
18023
8
434
134
1
Updatedpino@^2.2.0