Comparing version 8.1.0 to 8.2.0
@@ -56,3 +56,3 @@ 'use strict' | ||
} | ||
if (opts.enabled === false) opts.level = 'silent' | ||
if (opts.enabled === false || opts.browser.disabled) opts.level = 'silent' | ||
const level = opts.level || 'info' | ||
@@ -59,0 +59,0 @@ const logger = Object.create(proto) |
@@ -60,2 +60,4 @@ # API | ||
The minimum level to log: Pino will not log messages with a lower level. Setting this option reduces the load, as typically, debug and trace logs are only valid for development, and not needed in production. | ||
One of `'fatal'`, `'error'`, `'warn'`, `'info`', `'debug'`, `'trace'` or `'silent'`. | ||
@@ -62,0 +64,0 @@ |
@@ -200,1 +200,10 @@ # Browser API | ||
``` | ||
### `disabled` (Boolean) | ||
```js | ||
const pino = require('pino')({browser: {disabled: true}}) | ||
``` | ||
The `disabled` option will disable logging in browser if set | ||
to `true`. Default is set to `false`. |
@@ -46,3 +46,4 @@ ## Long Term Support | ||
| :------ | :----------- | :-------------- | :------------------- | | ||
| 7.x | 2021-10-14 | TBD | 12, 14, 16 | | ||
| 8.x | 2022-06-01 | TBD | 14, 16, 18 | | ||
| 7.x | 2021-10-14 | 2023-06-01 | 12, 14, 16 | | ||
| 6.x | 2020-03-07 | 2022-04-14 | 10, 12, 14, 16 | | ||
@@ -61,4 +62,4 @@ | ||
|---------|------------------------|--------------| | ||
| Linux | `ubuntu-latest` | 10,12,14,16 | | ||
| Windows | `windows-latest` | 10,12,14,16 | | ||
| MacOS | `macos-latest` | 10,12,14,16 | | ||
| Linux | `ubuntu-latest` | 14,16,18 | | ||
| Windows | `windows-latest` | 14,16,18 | | ||
| MacOS | `macos-latest` | 14,16,18 | |
@@ -383,2 +383,3 @@ # Transports | ||
+ [pino-sentry-transport](#pino-sentry-transport) | ||
+ [pino-airbrake-transport](#pino-airbrake-transport) | ||
@@ -728,2 +729,30 @@ ### Legacy | ||
<a id="pino-airbrake-transport"></a> | ||
### pino-airbrake-transport | ||
[pino-airbrake-transport][pino-airbrake-transport] is a Pino v7+ compatible transport to forward log events to [Airbrake][Airbrake] | ||
from a dedicated worker: | ||
```js | ||
const pino = require('pino') | ||
const transport = pino.transport({ | ||
target: 'pino-airbrake-transport', | ||
options: { | ||
airbrake: { | ||
projectId: 1, | ||
projectKey: "REPLACE_ME", | ||
environment: "production", | ||
// aditional options for airbrake | ||
performanceStats: false, | ||
}, | ||
}, | ||
level: "error", // minimum log level that should be sent to airbrake | ||
}) | ||
pino(transport) | ||
``` | ||
[pino-airbrake-transport]: https://github.com/enricodeleo/pino-airbrake-transport | ||
[Airbrake]: https://airbrake.io/ | ||
<a id="pino-socket"></a> | ||
@@ -730,0 +759,0 @@ ### pino-socket |
'use strict' | ||
const { version } = require('../package.json') | ||
module.exports = { version } | ||
module.exports = { version: '8.2.0' } |
{ | ||
"name": "pino", | ||
"version": "8.1.0", | ||
"version": "8.2.0", | ||
"description": "super fast, all natural json logger", | ||
@@ -106,3 +106,3 @@ "main": "pino.js", | ||
"ts-node": "^10.8.1", | ||
"tsd": "^0.21.0", | ||
"tsd": "^0.22.0", | ||
"typescript": "^4.7.3", | ||
@@ -116,3 +116,3 @@ "winston": "^3.7.2" | ||
"pino-abstract-transport": "v1.0.0", | ||
"pino-std-serializers": "^5.0.0", | ||
"pino-std-serializers": "^6.0.0", | ||
"process-warning": "^2.0.0", | ||
@@ -123,3 +123,3 @@ "quick-format-unescaped": "^4.0.3", | ||
"sonic-boom": "^3.0.0", | ||
"thread-stream": "^1.0.0" | ||
"thread-stream": "^2.0.0" | ||
}, | ||
@@ -126,0 +126,0 @@ "tsd": { |
@@ -5,2 +5,3 @@ 'use strict' | ||
const { readFileSync } = require('fs') | ||
const { join } = require('path') | ||
const test = require('tap').test | ||
@@ -542,2 +543,38 @@ const pino = require('../') | ||
test('multistream.write should not throw if one stream fails', function (t) { | ||
let messageCount = 0 | ||
const stream = writeStream(function (data, enc, cb) { | ||
messageCount += 1 | ||
cb() | ||
}) | ||
const noopStream = pino.transport({ | ||
target: join(__dirname, 'fixtures', 'noop-transport.js') | ||
}) | ||
// eslint-disable-next-line | ||
noopStream.on('error', function (err) { | ||
// something went wrong while writing to noop stream, ignoring! | ||
}) | ||
const log = pino({ | ||
level: 'trace' | ||
}, | ||
multistream([ | ||
{ | ||
level: 'trace', | ||
stream | ||
}, | ||
{ | ||
level: 'debug', | ||
stream: noopStream | ||
} | ||
]) | ||
) | ||
log.debug('0') | ||
noopStream.end() | ||
// noop stream is ending, should emit an error but not throw | ||
log.debug('1') | ||
log.debug('2') | ||
t.equal(messageCount, 3) | ||
t.end() | ||
}) | ||
test('flushSync', function (t) { | ||
@@ -544,0 +581,0 @@ const tmp = file() |
@@ -106,2 +106,3 @@ import P, { pino } from "../../"; | ||
}, | ||
disabled: false | ||
}, | ||
@@ -108,0 +109,0 @@ }); |
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
461164
145
11127
+ Addedpino-std-serializers@6.2.2(transitive)
+ Addedreal-require@0.2.0(transitive)
+ Addedthread-stream@2.7.0(transitive)
- Removedpino-std-serializers@5.6.0(transitive)
- Removedthread-stream@1.0.1(transitive)
Updatedpino-std-serializers@^6.0.0
Updatedthread-stream@^2.0.0