Repository: pinojs/pino
Pull request #1478 (2022-06-27 15:07:32)

build(deps): bump pino-std-serializers from 5.6.0 to 6.0.0
Bumps [pino-std-serializers](https://github.com/pinojs/pino-std-serializers) from 5.6.0 to 6.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/pinojs/pino-std-serializers/releases">pino-std-serializers's releases</a>.</em></p>
<blockquote>
<h2>v6.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>ci: update workflows by <a href="https://github.com/Fdawgs"><code>@​Fdawgs</code></a> in <a href="https://github-redirect.dependabot.com/pinojs/pino-std-serializers/pull/112">pinojs/pino-std-serializers#112</a></li>
<li>chore!: drop support for node 10, 12 and 15; add support for node 18 by <a href="https://github.com/Fdawgs"><code>@​Fdawgs</code></a> in <a href="https://github-redirect.dependabot.com/pinojs/pino-std-serializers/pull/113">pinojs/pino-std-serializers#113</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/pinojs/pino-std-serializers/compare/v5.6.0...v6.0.0">https://github.com/pinojs/pino-std-serializers/compare/v5.6.0...v6.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/8a825ddd984fc39e8e1ed31e4150c9179bd60a35"><code>8a825dd</code></a> Bumped v6.0.0</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/7b94715da9d514c9af8b14fda9295bf40fdd0dd6"><code>7b94715</code></a> chore!: drop support for node 10, 12 and 15; add support for node 18 (<a href="https://github-redirect.dependabot.com/pinojs/pino-std-serializers/issues/113">#113</a>)</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/d6800f0f29c9f17f2b9e3722eb04455c5b3389ce"><code>d6800f0</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pinojs/pino-std-serializers/issues/112">#112</a> from pinojs/chore/mass</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/d8bb7474a9ea40efe5adb4753a45ecacbc867978"><code>d8bb747</code></a> chore(.gitignore): remove old pnpm lockfile</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/21bc1e03e11284caa8e806472ec4e7c09896efb9"><code>21bc1e0</code></a> ci: add name to test job</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/f626a22b99e2e4197db306a541f68450313d5f7d"><code>f626a22</code></a> ci: update workflows</li>
<li><a href="https://github.com/pinojs/pino-std-serializers/commit/92ab78f84742a09e172eaa11106802e5069e711d"><code>92ab78f</code></a> chore(.gitignore): use latest github ignore template</li>
<li>See full diff in <a href="https://github.com/pinojs/pino-std-serializers/compare/v5.6.0...v6.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pino-std-serializers&package-manager=npm_and_yarn&previous-version=5.6.0&new-version=6.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** Dependabot was ignoring updates to this dependency, but since you've updated it yourself we've started tracking it for you again. 🤖

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9aef362..7843632 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,7 +31,7 @@ jobs:
           persist-credentials: false
 
       - name: Dependency review
-        uses: actions/dependency-review-action@v1
+        uses: actions/dependency-review-action@v2
 
   test:
     name: ${{ matrix.node-version }} ${{ matrix.os }}
diff --git a/browser.js b/browser.js
index 51989ba..8a72166 100644
--- a/browser.js
+++ b/browser.js
@@ -53,7 +53,7 @@ function pino (opts) {
     proto.error = proto.fatal = proto.warn =
     proto.info = proto.debug = proto.trace = proto
   }
-  if (opts.enabled === false) opts.level = 'silent'
+  if (opts.enabled === false || opts.browser.disabled) opts.level = 'silent'
   const level = opts.level || 'info'
   const logger = Object.create(proto)
   if (!logger.log) logger.log = noop
diff --git a/docs/api.md b/docs/api.md
index d9b0326..06ab0a2 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -57,6 +57,8 @@ The name of the logger. When set adds a `name` field to every JSON line logged.
 
 Default: `'info'`
 
+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'`.
 
 Additional levels can be added to the instance via the `customLevels` option.
diff --git a/docs/browser.md b/docs/browser.md
index cf8a692..0bfa42d 100644
--- a/docs/browser.md
+++ b/docs/browser.md
@@ -197,3 +197,12 @@ const pino = require('pino')({
   }
 })
 ```
+
+### `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`.
diff --git a/docs/lts.md b/docs/lts.md
index 4f4f2ea..115c266 100644
--- a/docs/lts.md
+++ b/docs/lts.md
@@ -43,7 +43,8 @@ A "month" is defined as 30 consecutive days.
 
 | Version | Release Date | End Of LTS Date | Node.js              |
 | :------ | :----------- | :-------------- | :------------------- |
-| 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       |
 
 <a name="supported-os"></a>
@@ -57,6 +58,6 @@ the YAML workflow labels below:
 
 | OS      | YAML Workflow Label    | Node.js      |
 |---------|------------------------|--------------|
-| 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     |
diff --git a/docs/transports.md b/docs/transports.md
index c3088c9..685014a 100644
--- a/docs/transports.md
+++ b/docs/transports.md
@@ -380,6 +380,7 @@ PR's to this document are welcome for any new transports!
 + [pino-loki](#pino-loki)
 + [pino-seq-transport](#pino-seq-transport)
 + [pino-sentry-transport](#pino-sentry-transport)
++ [pino-airbrake-transport](#pino-airbrake-transport)
 
 ### Legacy
 
@@ -724,6 +725,34 @@ pino(transport)
 [pino-sentry-transport]: https://github.com/tomer-yechiel/pino-sentry-transport
 [Sentry]: https://sentry.io/
 
+
+<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>
 ### pino-socket
 
diff --git a/lib/meta.js b/lib/meta.js
index 6195daa..dc92a0c 100644
--- a/lib/meta.js
+++ b/lib/meta.js
@@ -1,5 +1,3 @@
 'use strict'
 
-const { version } = require('../package.json')
-
-module.exports = { version }
+module.exports = { version: '8.1.0' }
diff --git a/package.json b/package.json
index cd68d85..ae86ced 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
     "tape": "^5.5.3",
     "through2": "^4.0.0",
     "ts-node": "^10.8.1",
-    "tsd": "^0.21.0",
+    "tsd": "^0.22.0",
     "typescript": "^4.7.3",
     "winston": "^3.7.2"
   },
@@ -112,13 +112,13 @@
     "fast-redact": "^3.1.1",
     "on-exit-leak-free": "^2.1.0",
     "pino-abstract-transport": "v1.0.0",
-    "pino-std-serializers": "^5.0.0",
+    "pino-std-serializers": "^6.0.0",
     "process-warning": "^2.0.0",
     "quick-format-unescaped": "^4.0.3",
     "real-require": "^0.1.0",
     "safe-stable-stringify": "^2.3.1",
     "sonic-boom": "^3.0.0",
-    "thread-stream": "^1.0.0"
+    "thread-stream": "^2.0.0"
   },
   "tsd": {
     "directory": "test/types"


Test patch:
diff --git a/test/browser-disabled.test.js b/test/browser-disabled.test.js
new file mode 100644
index 0000000..36d1b11
--- /dev/null
+++ b/test/browser-disabled.test.js
@@ -0,0 +1,87 @@
+'use strict'
+const test = require('tape')
+const pino = require('../browser')
+
+test('set browser opts disabled to true', ({ end, same }) => {
+  const instance = pino({
+    browser: {
+      disabled: true,
+      write (actual) {
+        checkLogObjects(same, actual, [])
+      }
+    }
+  })
+  instance.info('hello world')
+  instance.error('this is an error')
+  instance.fatal('this is fatal')
+
+  end()
+})
+
+test('set browser opts disabled to false', ({ end, same }) => {
+  const expected = [
+    {
+      level: 30,
+      msg: 'hello world'
+    },
+    {
+      level: 50,
+      msg: 'this is an error'
+    },
+    {
+      level: 60,
+      msg: 'this is fatal'
+    }
+  ]
+  const instance = pino({
+    browser: {
+      disabled: false,
+      write (actual) {
+        checkLogObjects(same, actual, expected.shift())
+      }
+    }
+  })
+  instance.info('hello world')
+  instance.error('this is an error')
+  instance.fatal('this is fatal')
+
+  end()
+})
+
+test('disabled is not set in browser opts', ({ end, same }) => {
+  const expected = [
+    {
+      level: 30,
+      msg: 'hello world'
+    },
+    {
+      level: 50,
+      msg: 'this is an error'
+    },
+    {
+      level: 60,
+      msg: 'this is fatal'
+    }
+  ]
+  const instance = pino({
+    browser: {
+      write (actual) {
+        checkLogObjects(same, actual, expected.shift())
+      }
+    }
+  })
+  instance.info('hello world')
+  instance.error('this is an error')
+  instance.fatal('this is fatal')
+
+  end()
+})
+
+function checkLogObjects (same, actual, expected, is) {
+  const actualCopy = Object.assign({}, actual)
+  const expectedCopy = Object.assign({}, expected)
+  delete actualCopy.time
+  delete expectedCopy.time
+
+  same(actualCopy, expectedCopy)
+}
diff --git a/test/types/pino.test-d.ts b/test/types/pino.test-d.ts
index 6dde5b2..b2a6515 100644
--- a/test/types/pino.test-d.ts
+++ b/test/types/pino.test-d.ts
@@ -103,6 +103,7 @@ pino({
                 logEvent.messages;
             },
         },
+        disabled: false
     },
 });