@contrast/agent-bundle 5.47.0 → 5.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@contrast/agent/package.json +10 -10
- package/node_modules/@contrast/agentify/package.json +14 -14
- package/node_modules/@contrast/architecture-components/package.json +4 -4
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/apollo-server.js +1 -1
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/graphql-yoga.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sinks/install/fs.js +8 -15
- package/node_modules/@contrast/assess/package.json +11 -11
- package/node_modules/@contrast/config/package.json +2 -2
- package/node_modules/@contrast/core/package.json +4 -4
- package/node_modules/@contrast/deadzones/package.json +4 -4
- package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +1 -10
- package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +1 -1
- package/node_modules/@contrast/dep-hooks/lib/index.d.ts +1 -1
- package/node_modules/@contrast/dep-hooks/lib/index.js +1 -1
- package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -1
- package/node_modules/@contrast/dep-hooks/lib/package-finder.js +11 -2
- package/node_modules/@contrast/dep-hooks/package.json +3 -3
- package/node_modules/@contrast/esm-hooks/package.json +5 -5
- package/node_modules/@contrast/instrumentation/package.json +4 -4
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +144 -202
- package/node_modules/@contrast/library-analysis/package.json +3 -3
- package/node_modules/@contrast/logger/package.json +3 -3
- package/node_modules/@contrast/metrics/package.json +5 -5
- package/node_modules/@contrast/patcher/package.json +2 -2
- package/node_modules/@contrast/protect/lib/input-tracing/install/fs.js +0 -8
- package/node_modules/@contrast/protect/package.json +10 -10
- package/node_modules/@contrast/reporter/package.json +5 -5
- package/node_modules/@contrast/rewriter/package.json +4 -4
- package/node_modules/@contrast/route-coverage/lib/index.d.ts +2 -0
- package/node_modules/@contrast/route-coverage/lib/index.js +2 -1
- package/node_modules/@contrast/route-coverage/lib/install/express.js +535 -0
- package/node_modules/@contrast/route-coverage/lib/install/fastify/fastify-express.js +71 -0
- package/node_modules/@contrast/route-coverage/lib/install/fastify/fastify-middie.js +67 -0
- package/node_modules/@contrast/route-coverage/lib/install/{fastify.js → fastify/fastify.js} +12 -12
- package/node_modules/@contrast/route-coverage/lib/install/{express → fastify}/index.js +6 -5
- package/node_modules/@contrast/route-coverage/lib/install/koa.js +39 -45
- package/node_modules/@contrast/route-coverage/lib/utils/route-info.js +26 -1
- package/node_modules/@contrast/route-coverage/package.json +7 -7
- package/node_modules/@contrast/scopes/package.json +5 -5
- package/node_modules/@contrast/sec-obs/package.json +8 -8
- package/node_modules/@contrast/sources/package.json +2 -2
- package/node_modules/@contrast/telemetry/package.json +4 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +697 -30
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +697 -30
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +877 -49
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +877 -49
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +697 -30
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +697 -30
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +877 -49
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +877 -49
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +697 -30
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +729 -61
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +877 -49
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +886 -56
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +13 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -5
- package/node_modules/{pino → @pinojs/redact}/.github/dependabot.yml +1 -1
- package/node_modules/@pinojs/redact/.github/workflows/ci.yml +48 -0
- package/node_modules/@pinojs/redact/.github/workflows/publish-release.yml +43 -0
- package/node_modules/{abort-controller → @pinojs/redact}/LICENSE +1 -1
- package/node_modules/@pinojs/redact/README.md +350 -0
- package/node_modules/@pinojs/redact/benchmarks/basic.js +184 -0
- package/node_modules/@pinojs/redact/eslint.config.js +1 -0
- package/node_modules/@pinojs/redact/index.d.ts +52 -0
- package/node_modules/@pinojs/redact/index.js +529 -0
- package/node_modules/@pinojs/redact/index.test-d.ts +22 -0
- package/node_modules/@pinojs/redact/package.json +37 -0
- package/node_modules/@pinojs/redact/scripts/sync-version.mjs +20 -0
- package/node_modules/@pinojs/redact/test/actual-redact-comparison.test.js +211 -0
- package/node_modules/@pinojs/redact/test/index.test.js +824 -0
- package/node_modules/@pinojs/redact/test/integration.test.js +390 -0
- package/node_modules/@pinojs/redact/test/multiple-wildcards.test.js +227 -0
- package/node_modules/@pinojs/redact/test/prototype-pollution.test.js +223 -0
- package/node_modules/@pinojs/redact/test/selective-clone.test.js +115 -0
- package/node_modules/@pinojs/redact/tsconfig.json +19 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/console.d.ts +3 -2
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +7 -0
- package/node_modules/@types/node/sqlite.d.ts +107 -0
- package/node_modules/@types/node/url.d.ts +32 -8
- package/node_modules/axios/CHANGELOG.md +18 -0
- package/node_modules/axios/README.md +1 -4
- package/node_modules/axios/dist/axios.js +2 -2
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +2 -2
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +2 -2
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +25 -20
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/lib/adapters/http.js +22 -18
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/package.json +1 -1
- package/node_modules/form-data/CHANGELOG.md +60 -2
- package/node_modules/form-data/README.md +4 -4
- package/node_modules/form-data/lib/form_data.js +2 -2
- package/node_modules/form-data/package.json +4 -4
- package/node_modules/ipaddr.js/README.md +1 -0
- package/node_modules/ipaddr.js/ipaddr.min.js +1 -1
- package/node_modules/ipaddr.js/lib/ipaddr.js +11 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +1 -0
- package/node_modules/ipaddr.js/package.json +2 -3
- package/node_modules/nan/.github/workflows/ci.yml +3 -1
- package/node_modules/nan/CHANGELOG.md +4 -1
- package/node_modules/nan/README.md +2 -2
- package/node_modules/nan/nan.h +25 -15
- package/node_modules/nan/nan_maybe_43_inl.h +5 -1
- package/node_modules/nan/package.json +2 -2
- package/node_modules/node-abi/abi_registry.json +8 -1
- package/node_modules/node-abi/package.json +1 -1
- package/node_modules/pino/CONTRIBUTING.md +4 -0
- package/node_modules/pino/LICENSE +1 -1
- package/node_modules/pino/README.md +20 -3
- package/node_modules/pino/benchmarks/basic.bench.js +1 -1
- package/node_modules/pino/benchmarks/child-child.bench.js +1 -1
- package/node_modules/pino/benchmarks/child-creation.bench.js +1 -1
- package/node_modules/pino/benchmarks/child.bench.js +1 -1
- package/node_modules/pino/benchmarks/deep-object.bench.js +1 -1
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +1 -1
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +1 -1
- package/node_modules/pino/benchmarks/internal/redact.bench.js +1 -1
- package/node_modules/pino/benchmarks/long-string.bench.js +1 -1
- package/node_modules/pino/benchmarks/multi-arg.bench.js +1 -1
- package/node_modules/pino/benchmarks/multistream.js +1 -1
- package/node_modules/pino/benchmarks/object.bench.js +1 -1
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +2 -2
- package/node_modules/pino/benchmarks/utils/runbench.js +3 -3
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +2 -2
- package/node_modules/pino/browser.js +76 -36
- package/node_modules/pino/build/sync-version.js +18 -3
- package/node_modules/pino/docs/api.md +155 -13
- package/node_modules/pino/docs/browser.md +16 -1
- package/node_modules/pino/docs/bundling.md +5 -3
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +15 -12
- package/node_modules/pino/docs/help.md +29 -3
- package/node_modules/pino/docs/lts.md +5 -4
- package/node_modules/pino/docs/transports.md +442 -271
- package/node_modules/pino/docs/web.md +59 -9
- package/node_modules/pino/eslint.config.js +19 -0
- package/node_modules/pino/examples/transport.js +2 -2
- package/node_modules/pino/file.js +1 -1
- package/node_modules/pino/lib/meta.js +1 -1
- package/node_modules/pino/lib/multistream.js +17 -2
- package/node_modules/pino/lib/proto.js +35 -11
- package/node_modules/pino/lib/redaction.js +9 -13
- package/node_modules/pino/lib/time.js +29 -1
- package/node_modules/pino/lib/tools.js +37 -8
- package/node_modules/pino/lib/transport-stream.js +10 -4
- package/node_modules/pino/lib/transport.js +23 -9
- package/node_modules/pino/lib/worker.js +164 -24
- package/node_modules/pino/package.json +28 -27
- package/node_modules/pino/pino.d.ts +244 -203
- package/node_modules/pino/pino.js +7 -3
- package/node_modules/pino/test/basic.test.js +181 -169
- package/node_modules/pino/test/broken-pipe.test.js +18 -16
- package/node_modules/pino/test/browser-child.test.js +26 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-serializers.test.js +0 -2
- package/node_modules/pino/test/browser-transmit.test.js +68 -0
- package/node_modules/pino/test/browser.test.js +98 -13
- package/node_modules/pino/test/complex-objects.test.js +8 -6
- package/node_modules/pino/test/crlf.test.js +7 -5
- package/node_modules/pino/test/custom-levels.test.js +80 -66
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +48 -43
- package/node_modules/pino/test/escaping.test.js +8 -6
- package/node_modules/pino/test/esm/esm.mjs +5 -3
- package/node_modules/pino/test/esm/index.test.js +14 -27
- package/node_modules/pino/test/esm/named-exports.mjs +9 -8
- package/node_modules/pino/test/exit.test.js +18 -16
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +1 -1
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +1 -1
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +1 -1
- package/node_modules/pino/test/fixtures/console-transport.js +1 -1
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +1 -1
- package/node_modules/pino/test/fixtures/destination-exit.js +1 -1
- package/node_modules/pino/test/fixtures/noop-transport.js +1 -1
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +1 -1
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +1 -1
- package/node_modules/pino/test/fixtures/syncfalse-child.js +1 -1
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +1 -1
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +1 -1
- package/node_modules/pino/test/fixtures/syncfalse.js +1 -1
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +3 -3
- package/node_modules/pino/test/fixtures/to-file-transport.js +2 -2
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +2 -2
- package/node_modules/pino/test/fixtures/transport/index.js +2 -2
- package/node_modules/pino/test/fixtures/transport-main.js +1 -1
- package/node_modules/pino/test/fixtures/transport-transform.js +1 -1
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +1 -1
- package/node_modules/pino/test/fixtures/transport-worker-data.js +1 -1
- package/node_modules/pino/test/fixtures/transport-worker.js +2 -2
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +3 -3
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +2 -2
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +1 -1
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +1 -1
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +1 -1
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +1 -1
- package/node_modules/pino/test/formatters.test.js +46 -37
- package/node_modules/pino/test/helper.d.ts +1 -1
- package/node_modules/pino/test/helper.js +37 -10
- package/node_modules/pino/test/hooks.test.js +45 -28
- package/node_modules/pino/test/http.test.js +39 -67
- package/node_modules/pino/test/internals/version.test.js +11 -9
- package/node_modules/pino/test/is-level-enabled.test.js +66 -72
- package/node_modules/pino/test/levels.test.js +245 -141
- package/node_modules/pino/test/metadata.test.js +45 -31
- package/node_modules/pino/test/mixin-merge-strategy.test.js +9 -7
- package/node_modules/pino/test/mixin.test.js +63 -40
- package/node_modules/pino/test/multistream.test.js +174 -118
- package/node_modules/pino/test/redact.test.js +172 -126
- package/node_modules/pino/test/serializers.test.js +61 -57
- package/node_modules/pino/test/stdout-protection.test.js +14 -12
- package/node_modules/pino/test/syncfalse.test.js +29 -34
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +37 -34
- package/node_modules/pino/test/transport/big.test.js +11 -12
- package/node_modules/pino/test/transport/bundlers-support.test.js +15 -43
- package/node_modules/pino/test/transport/caller.test.js +9 -8
- package/node_modules/pino/test/transport/core.test.js +175 -145
- package/node_modules/pino/test/transport/core.transpiled.test.ts +17 -19
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +21 -19
- package/node_modules/pino/test/transport/pipeline.test.js +109 -8
- package/node_modules/pino/test/transport/repl.test.js +4 -3
- package/node_modules/pino/test/transport/{syncfalse.test.js → sync-false.test.js} +14 -12
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +25 -5
- package/node_modules/pino/test/transport/uses-pino-config.test.js +16 -17
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/{pino-import.test-d.ts → pino-import.test-d.cts} +4 -3
- package/node_modules/pino/test/types/pino-multistream.test-d.ts +1 -1
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +1 -0
- package/node_modules/pino/test/types/pino-transport.test-d.ts +1 -1
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +24 -6
- package/node_modules/pino/test/types/pino.test-d.ts +161 -6
- package/node_modules/pino/test/types/pino.ts +31 -19
- package/node_modules/pino/tsconfig.json +1 -1
- package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +2 -4
- package/node_modules/pino-abstract-transport/index.js +1 -1
- package/node_modules/pino-abstract-transport/package.json +2 -3
- package/node_modules/pino-abstract-transport/test/base.test.js +1 -1
- package/node_modules/pino-abstract-transport/test/worker.test.js +7 -14
- package/node_modules/pino-std-serializers/.github/workflows/ci.yml +5 -5
- package/node_modules/pino-std-serializers/Readme.md +1 -0
- package/node_modules/pino-std-serializers/package.json +9 -8
- package/node_modules/pino-std-serializers/test/err-with-cause.test.js +72 -88
- package/node_modules/pino-std-serializers/test/err.test.js +76 -91
- package/node_modules/pino-std-serializers/test/req.test.js +142 -98
- package/node_modules/pino-std-serializers/test/res.test.js +42 -31
- package/node_modules/process-warning/.github/dependabot.yml +1 -1
- package/node_modules/process-warning/.github/workflows/ci.yml +1 -2
- package/node_modules/process-warning/README.md +4 -4
- package/node_modules/process-warning/eslint.config.js +6 -0
- package/node_modules/process-warning/package.json +39 -8
- package/node_modules/process-warning/test/emit-interpolated-string.test.js +11 -6
- package/node_modules/process-warning/test/emit-once-only.test.js +11 -6
- package/node_modules/process-warning/test/emit-reset.test.js +10 -6
- package/node_modules/process-warning/test/emit-set.test.js +10 -5
- package/node_modules/process-warning/test/emit-unlimited.test.js +12 -7
- package/node_modules/process-warning/test/index.test.js +20 -20
- package/node_modules/process-warning/test/issue-88.test.js +8 -3
- package/node_modules/process-warning/test/jest.test.js +17 -15
- package/node_modules/process-warning/test/no-warnings.test.js +9 -9
- package/node_modules/process-warning/test/promise.js +10 -0
- package/node_modules/process-warning/types/index.d.ts +5 -5
- package/node_modules/thread-stream/.github/workflows/ci.yml +4 -8
- package/node_modules/thread-stream/index.d.ts +4 -5
- package/node_modules/thread-stream/lib/worker.js +5 -2
- package/node_modules/thread-stream/package.json +6 -4
- package/node_modules/thread-stream/test/base.test.js +12 -0
- package/node_modules/thread-stream/test/never-drain.test.js +3 -1
- package/node_modules/thread-stream/test/pkg/pkg.test.js +2 -0
- package/node_modules/thread-stream/test/syntax-error.mjs +2 -0
- package/node_modules/thread-stream/tsconfig.json +8 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +1 -1
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -1
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -2
- package/node_modules/yaml/browser/dist/errors.js +1 -1
- package/node_modules/yaml/browser/dist/nodes/Alias.js +1 -1
- package/node_modules/yaml/browser/dist/parse/parser.js +2 -2
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +1 -1
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
- package/node_modules/yaml/dist/compose/compose-collection.js +1 -1
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -1
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -2
- package/node_modules/yaml/dist/errors.js +1 -1
- package/node_modules/yaml/dist/nodes/Alias.js +1 -1
- package/node_modules/yaml/dist/parse/parser.js +2 -2
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +1 -1
- package/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
- package/node_modules/yaml/package.json +4 -4
- package/package.json +2 -2
- package/node_modules/@contrast/route-coverage/lib/install/express/express4.js +0 -157
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -553
- package/node_modules/abort-controller/README.md +0 -98
- package/node_modules/abort-controller/browser.js +0 -13
- package/node_modules/abort-controller/browser.mjs +0 -11
- package/node_modules/abort-controller/dist/abort-controller.d.ts +0 -43
- package/node_modules/abort-controller/dist/abort-controller.js +0 -127
- package/node_modules/abort-controller/dist/abort-controller.js.map +0 -1
- package/node_modules/abort-controller/dist/abort-controller.mjs +0 -118
- package/node_modules/abort-controller/dist/abort-controller.mjs.map +0 -1
- package/node_modules/abort-controller/dist/abort-controller.umd.js +0 -5
- package/node_modules/abort-controller/dist/abort-controller.umd.js.map +0 -1
- package/node_modules/abort-controller/package.json +0 -97
- package/node_modules/abort-controller/polyfill.js +0 -21
- package/node_modules/abort-controller/polyfill.mjs +0 -19
- package/node_modules/base64-js/LICENSE +0 -21
- package/node_modules/base64-js/README.md +0 -34
- package/node_modules/base64-js/base64js.min.js +0 -1
- package/node_modules/base64-js/index.d.ts +0 -3
- package/node_modules/base64-js/index.js +0 -150
- package/node_modules/base64-js/package.json +0 -47
- package/node_modules/buffer/AUTHORS.md +0 -73
- package/node_modules/buffer/LICENSE +0 -21
- package/node_modules/buffer/README.md +0 -410
- package/node_modules/buffer/index.d.ts +0 -194
- package/node_modules/buffer/index.js +0 -2106
- package/node_modules/buffer/package.json +0 -93
- package/node_modules/event-target-shim/LICENSE +0 -22
- package/node_modules/event-target-shim/README.md +0 -293
- package/node_modules/event-target-shim/dist/event-target-shim.js +0 -871
- package/node_modules/event-target-shim/dist/event-target-shim.js.map +0 -1
- package/node_modules/event-target-shim/dist/event-target-shim.mjs +0 -862
- package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +0 -1
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js +0 -6
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +0 -1
- package/node_modules/event-target-shim/index.d.ts +0 -399
- package/node_modules/event-target-shim/package.json +0 -82
- package/node_modules/events/.airtap.yml +0 -15
- package/node_modules/events/.github/FUNDING.yml +0 -12
- package/node_modules/events/.travis.yml +0 -18
- package/node_modules/events/History.md +0 -118
- package/node_modules/events/LICENSE +0 -22
- package/node_modules/events/Readme.md +0 -50
- package/node_modules/events/events.js +0 -497
- package/node_modules/events/package.json +0 -37
- package/node_modules/events/security.md +0 -10
- package/node_modules/events/tests/add-listeners.js +0 -111
- package/node_modules/events/tests/check-listener-leaks.js +0 -101
- package/node_modules/events/tests/common.js +0 -104
- package/node_modules/events/tests/errors.js +0 -13
- package/node_modules/events/tests/events-list.js +0 -28
- package/node_modules/events/tests/events-once.js +0 -234
- package/node_modules/events/tests/index.js +0 -64
- package/node_modules/events/tests/legacy-compat.js +0 -16
- package/node_modules/events/tests/listener-count.js +0 -37
- package/node_modules/events/tests/listeners-side-effects.js +0 -56
- package/node_modules/events/tests/listeners.js +0 -168
- package/node_modules/events/tests/max-listeners.js +0 -47
- package/node_modules/events/tests/method-names.js +0 -35
- package/node_modules/events/tests/modify-in-emit.js +0 -90
- package/node_modules/events/tests/num-args.js +0 -60
- package/node_modules/events/tests/once.js +0 -83
- package/node_modules/events/tests/prepend.js +0 -31
- package/node_modules/events/tests/remove-all-listeners.js +0 -133
- package/node_modules/events/tests/remove-listeners.js +0 -212
- package/node_modules/events/tests/set-max-listeners-side-effects.js +0 -31
- package/node_modules/events/tests/special-event-names.js +0 -45
- package/node_modules/events/tests/subclass.js +0 -66
- package/node_modules/events/tests/symbols.js +0 -25
- package/node_modules/fast-redact/.github/workflows/ci.yml +0 -37
- package/node_modules/fast-redact/LICENSE +0 -21
- package/node_modules/fast-redact/benchmark/index.js +0 -223
- package/node_modules/fast-redact/example/default-usage.js +0 -14
- package/node_modules/fast-redact/example/intermediate-wildcard-array.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array-depth.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array-end.js +0 -11
- package/node_modules/fast-redact/example/multi-wildcard-array.js +0 -11
- package/node_modules/fast-redact/example/serialize-false.js +0 -11
- package/node_modules/fast-redact/example/serialize-function.js +0 -4
- package/node_modules/fast-redact/example/top-wildcard-object.js +0 -9
- package/node_modules/fast-redact/index.js +0 -56
- package/node_modules/fast-redact/lib/modifiers.js +0 -291
- package/node_modules/fast-redact/lib/parse.js +0 -44
- package/node_modules/fast-redact/lib/redactor.js +0 -108
- package/node_modules/fast-redact/lib/restorer.js +0 -92
- package/node_modules/fast-redact/lib/rx.js +0 -16
- package/node_modules/fast-redact/lib/state.js +0 -20
- package/node_modules/fast-redact/lib/validator.js +0 -33
- package/node_modules/fast-redact/package.json +0 -50
- package/node_modules/fast-redact/readme.md +0 -282
- package/node_modules/fast-redact/test/index.js +0 -1502
- package/node_modules/ieee754/LICENSE +0 -11
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -52
- package/node_modules/pino/.eslintignore +0 -2
- package/node_modules/pino/.eslintrc +0 -8
- package/node_modules/pino/.github/workflows/bench.yml +0 -61
- package/node_modules/pino/.github/workflows/ci.yml +0 -86
- package/node_modules/pino/.github/workflows/lock-threads.yml +0 -30
- package/node_modules/pino/.github/workflows/package-manager-ci.yml +0 -99
- package/node_modules/pino/.github/workflows/target-main.yml +0 -23
- package/node_modules/pino/.taprc.yaml +0 -8
- package/node_modules/pino/docsify/sidebar.md +0 -26
- package/node_modules/pino/favicon-16x16.png +0 -0
- package/node_modules/pino/favicon-32x32.png +0 -0
- package/node_modules/pino/lib/worker-pipeline.js +0 -38
- package/node_modules/pino/node_modules/sonic-boom/.eslintignore +0 -2
- package/node_modules/pino/node_modules/sonic-boom/.husky/pre-commit +0 -4
- package/node_modules/pino/node_modules/sonic-boom/.taprc.yaml +0 -11
- package/node_modules/pino/node_modules/sonic-boom/LICENSE +0 -21
- package/node_modules/pino/node_modules/sonic-boom/README.md +0 -151
- package/node_modules/pino/node_modules/sonic-boom/bench.js +0 -98
- package/node_modules/pino/node_modules/sonic-boom/check.js +0 -18
- package/node_modules/pino/node_modules/sonic-boom/example.js +0 -8
- package/node_modules/pino/node_modules/sonic-boom/fixtures/firehose.js +0 -22
- package/node_modules/pino/node_modules/sonic-boom/index.js +0 -690
- package/node_modules/pino/node_modules/sonic-boom/package.json +0 -50
- package/node_modules/pino/node_modules/sonic-boom/test/destroy.test.js +0 -49
- package/node_modules/pino/node_modules/sonic-boom/test/end.test.js +0 -98
- package/node_modules/pino/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
- package/node_modules/pino/node_modules/sonic-boom/test/flush.test.js +0 -419
- package/node_modules/pino/node_modules/sonic-boom/test/fsync.test.js +0 -63
- package/node_modules/pino/node_modules/sonic-boom/test/helper.js +0 -42
- package/node_modules/pino/node_modules/sonic-boom/test/minlength.test.js +0 -35
- package/node_modules/pino/node_modules/sonic-boom/test/mode.test.js +0 -116
- package/node_modules/pino/node_modules/sonic-boom/test/reopen.test.js +0 -239
- package/node_modules/pino/node_modules/sonic-boom/test/retry.test.js +0 -414
- package/node_modules/pino/node_modules/sonic-boom/test/sync.test.js +0 -261
- package/node_modules/pino/node_modules/sonic-boom/test/write.test.js +0 -465
- package/node_modules/pino/node_modules/sonic-boom/types/index.d.ts +0 -62
- package/node_modules/pino/node_modules/sonic-boom/types/tests/test.ts +0 -4
- package/node_modules/pino/pino-banner.png +0 -0
- package/node_modules/pino/pino-logo-hire.png +0 -0
- package/node_modules/pino/pino-tree.png +0 -0
- package/node_modules/pino/pretty-demo.png +0 -0
- package/node_modules/pino/test/errorKey.test.js +0 -34
- package/node_modules/pino/test/transport/core.test.ts +0 -236
- package/node_modules/pino-std-serializers/.taprc +0 -2
- package/node_modules/process/.eslintrc +0 -21
- package/node_modules/process/LICENSE +0 -22
- package/node_modules/process/README.md +0 -26
- package/node_modules/process/browser.js +0 -184
- package/node_modules/process/index.js +0 -2
- package/node_modules/process/package.json +0 -27
- package/node_modules/process/test.js +0 -199
- package/node_modules/process-warning/.taprc +0 -2
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -116
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -4
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -4
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -4
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -4
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -4
- package/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +0 -52
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -157
- package/node_modules/readable-stream/lib/internal/streams/compose.js +0 -194
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -290
- package/node_modules/readable-stream/lib/internal/streams/duplex.js +0 -143
- package/node_modules/readable-stream/lib/internal/streams/duplexify.js +0 -378
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -286
- package/node_modules/readable-stream/lib/internal/streams/from.js +0 -98
- package/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +0 -51
- package/node_modules/readable-stream/lib/internal/streams/legacy.js +0 -89
- package/node_modules/readable-stream/lib/internal/streams/operators.js +0 -457
- package/node_modules/readable-stream/lib/internal/streams/passthrough.js +0 -39
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -471
- package/node_modules/readable-stream/lib/internal/streams/readable.js +0 -1290
- package/node_modules/readable-stream/lib/internal/streams/state.js +0 -39
- package/node_modules/readable-stream/lib/internal/streams/transform.js +0 -180
- package/node_modules/readable-stream/lib/internal/streams/utils.js +0 -327
- package/node_modules/readable-stream/lib/internal/streams/writable.js +0 -819
- package/node_modules/readable-stream/lib/internal/validators.js +0 -530
- package/node_modules/readable-stream/lib/ours/browser.js +0 -35
- package/node_modules/readable-stream/lib/ours/errors.js +0 -343
- package/node_modules/readable-stream/lib/ours/index.js +0 -65
- package/node_modules/readable-stream/lib/ours/primordials.js +0 -124
- package/node_modules/readable-stream/lib/ours/util/inspect.js +0 -55
- package/node_modules/readable-stream/lib/ours/util.js +0 -148
- package/node_modules/readable-stream/lib/stream/promises.js +0 -43
- package/node_modules/readable-stream/lib/stream.js +0 -143
- package/node_modules/readable-stream/package.json +0 -88
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -65
- package/node_modules/safe-buffer/package.json +0 -51
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -34
|
@@ -1,80 +1,83 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const {
|
|
5
|
-
const
|
|
2
|
+
|
|
3
|
+
const os = require('node:os')
|
|
4
|
+
const { readFileSync } = require('node:fs')
|
|
5
|
+
const test = require('node:test')
|
|
6
|
+
const assert = require('node:assert')
|
|
7
|
+
|
|
8
|
+
const { sink, check, match, once, watchFileCreated, file } = require('./helper')
|
|
6
9
|
const pino = require('../')
|
|
7
10
|
const { version } = require('../package.json')
|
|
8
11
|
const { pid } = process
|
|
9
12
|
const hostname = os.hostname()
|
|
10
13
|
|
|
11
|
-
test('pino version is exposed on export',
|
|
12
|
-
equal(pino.version, version)
|
|
14
|
+
test('pino version is exposed on export', () => {
|
|
15
|
+
assert.equal(pino.version, version)
|
|
13
16
|
})
|
|
14
17
|
|
|
15
|
-
test('pino version is exposed on instance',
|
|
18
|
+
test('pino version is exposed on instance', () => {
|
|
16
19
|
const instance = pino()
|
|
17
|
-
equal(instance.version, version)
|
|
20
|
+
assert.equal(instance.version, version)
|
|
18
21
|
})
|
|
19
22
|
|
|
20
|
-
test('child instance exposes pino version',
|
|
23
|
+
test('child instance exposes pino version', () => {
|
|
21
24
|
const child = pino().child({ foo: 'bar' })
|
|
22
|
-
equal(child.version, version)
|
|
25
|
+
assert.equal(child.version, version)
|
|
23
26
|
})
|
|
24
27
|
|
|
25
|
-
test('bindings are exposed on every instance',
|
|
28
|
+
test('bindings are exposed on every instance', () => {
|
|
26
29
|
const instance = pino()
|
|
27
|
-
|
|
30
|
+
assert.deepEqual(instance.bindings(), {})
|
|
28
31
|
})
|
|
29
32
|
|
|
30
|
-
test('bindings contain the name and the child bindings',
|
|
33
|
+
test('bindings contain the name and the child bindings', () => {
|
|
31
34
|
const instance = pino({ name: 'basicTest', level: 'info' }).child({ foo: 'bar' }).child({ a: 2 })
|
|
32
|
-
|
|
35
|
+
assert.deepEqual(instance.bindings(), { name: 'basicTest', foo: 'bar', a: 2 })
|
|
33
36
|
})
|
|
34
37
|
|
|
35
|
-
test('set bindings on instance',
|
|
38
|
+
test('set bindings on instance', () => {
|
|
36
39
|
const instance = pino({ name: 'basicTest', level: 'info' })
|
|
37
40
|
instance.setBindings({ foo: 'bar' })
|
|
38
|
-
|
|
41
|
+
assert.deepEqual(instance.bindings(), { name: 'basicTest', foo: 'bar' })
|
|
39
42
|
})
|
|
40
43
|
|
|
41
|
-
test('newly set bindings overwrite old bindings',
|
|
44
|
+
test('newly set bindings overwrite old bindings', () => {
|
|
42
45
|
const instance = pino({ name: 'basicTest', level: 'info', base: { foo: 'bar' } })
|
|
43
46
|
instance.setBindings({ foo: 'baz' })
|
|
44
|
-
|
|
47
|
+
assert.deepEqual(instance.bindings(), { name: 'basicTest', foo: 'baz' })
|
|
45
48
|
})
|
|
46
49
|
|
|
47
|
-
test('set bindings on child instance',
|
|
50
|
+
test('set bindings on child instance', () => {
|
|
48
51
|
const child = pino({ name: 'basicTest', level: 'info' }).child({})
|
|
49
52
|
child.setBindings({ foo: 'bar' })
|
|
50
|
-
|
|
53
|
+
assert.deepEqual(child.bindings(), { name: 'basicTest', foo: 'bar' })
|
|
51
54
|
})
|
|
52
55
|
|
|
53
|
-
test('child should have bindings set by parent',
|
|
56
|
+
test('child should have bindings set by parent', () => {
|
|
54
57
|
const instance = pino({ name: 'basicTest', level: 'info' })
|
|
55
58
|
instance.setBindings({ foo: 'bar' })
|
|
56
59
|
const child = instance.child({})
|
|
57
|
-
|
|
60
|
+
assert.deepEqual(child.bindings(), { name: 'basicTest', foo: 'bar' })
|
|
58
61
|
})
|
|
59
62
|
|
|
60
|
-
test('child should not share bindings of parent set after child creation',
|
|
63
|
+
test('child should not share bindings of parent set after child creation', () => {
|
|
61
64
|
const instance = pino({ name: 'basicTest', level: 'info' })
|
|
62
65
|
const child = instance.child({})
|
|
63
66
|
instance.setBindings({ foo: 'bar' })
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
assert.deepEqual(instance.bindings(), { name: 'basicTest', foo: 'bar' })
|
|
68
|
+
assert.deepEqual(child.bindings(), { name: 'basicTest' })
|
|
66
69
|
})
|
|
67
70
|
|
|
68
71
|
function levelTest (name, level) {
|
|
69
|
-
test(`${name} logs as ${level}`, async (
|
|
72
|
+
test(`${name} logs as ${level}`, async () => {
|
|
70
73
|
const stream = sink()
|
|
71
74
|
const instance = pino(stream)
|
|
72
75
|
instance.level = name
|
|
73
76
|
instance[name]('hello world')
|
|
74
|
-
check(equal, await once(stream, 'data'), level, 'hello world')
|
|
77
|
+
check(assert.equal, await once(stream, 'data'), level, 'hello world')
|
|
75
78
|
})
|
|
76
79
|
|
|
77
|
-
test(`passing objects at level ${name}`, async (
|
|
80
|
+
test(`passing objects at level ${name}`, async () => {
|
|
78
81
|
const stream = sink()
|
|
79
82
|
const instance = pino(stream)
|
|
80
83
|
instance.level = name
|
|
@@ -82,42 +85,42 @@ function levelTest (name, level) {
|
|
|
82
85
|
instance[name](obj)
|
|
83
86
|
|
|
84
87
|
const result = await once(stream, 'data')
|
|
85
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
86
|
-
equal(result.pid, pid)
|
|
87
|
-
equal(result.hostname, hostname)
|
|
88
|
-
equal(result.level, level)
|
|
89
|
-
equal(result.hello, 'world')
|
|
90
|
-
|
|
88
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
89
|
+
assert.equal(result.pid, pid)
|
|
90
|
+
assert.equal(result.hostname, hostname)
|
|
91
|
+
assert.equal(result.level, level)
|
|
92
|
+
assert.equal(result.hello, 'world')
|
|
93
|
+
assert.deepEqual(Object.keys(obj), ['hello'])
|
|
91
94
|
})
|
|
92
95
|
|
|
93
|
-
test(`passing an object and a string at level ${name}`, async (
|
|
96
|
+
test(`passing an object and a string at level ${name}`, async () => {
|
|
94
97
|
const stream = sink()
|
|
95
98
|
const instance = pino(stream)
|
|
96
99
|
instance.level = name
|
|
97
100
|
const obj = { hello: 'world' }
|
|
98
101
|
instance[name](obj, 'a string')
|
|
99
102
|
const result = await once(stream, 'data')
|
|
100
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
103
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
101
104
|
delete result.time
|
|
102
|
-
|
|
105
|
+
assert.deepEqual(result, {
|
|
103
106
|
pid,
|
|
104
107
|
hostname,
|
|
105
108
|
level,
|
|
106
109
|
msg: 'a string',
|
|
107
110
|
hello: 'world'
|
|
108
111
|
})
|
|
109
|
-
|
|
112
|
+
assert.deepEqual(Object.keys(obj), ['hello'])
|
|
110
113
|
})
|
|
111
114
|
|
|
112
|
-
test(`passing a undefined and a string at level ${name}`, async (
|
|
115
|
+
test(`passing a undefined and a string at level ${name}`, async () => {
|
|
113
116
|
const stream = sink()
|
|
114
117
|
const instance = pino(stream)
|
|
115
118
|
instance.level = name
|
|
116
119
|
instance[name](undefined, 'a string')
|
|
117
120
|
const result = await once(stream, 'data')
|
|
118
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
121
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
119
122
|
delete result.time
|
|
120
|
-
|
|
123
|
+
assert.deepEqual(result, {
|
|
121
124
|
pid,
|
|
122
125
|
hostname,
|
|
123
126
|
level,
|
|
@@ -125,15 +128,15 @@ function levelTest (name, level) {
|
|
|
125
128
|
})
|
|
126
129
|
})
|
|
127
130
|
|
|
128
|
-
test(`overriding object key by string at level ${name}`, async (
|
|
131
|
+
test(`overriding object key by string at level ${name}`, async () => {
|
|
129
132
|
const stream = sink()
|
|
130
133
|
const instance = pino(stream)
|
|
131
134
|
instance.level = name
|
|
132
135
|
instance[name]({ hello: 'world', msg: 'object' }, 'string')
|
|
133
136
|
const result = await once(stream, 'data')
|
|
134
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
137
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
135
138
|
delete result.time
|
|
136
|
-
|
|
139
|
+
assert.deepEqual(result, {
|
|
137
140
|
pid,
|
|
138
141
|
hostname,
|
|
139
142
|
level,
|
|
@@ -142,16 +145,16 @@ function levelTest (name, level) {
|
|
|
142
145
|
})
|
|
143
146
|
})
|
|
144
147
|
|
|
145
|
-
test(`formatting logs as ${name}`, async (
|
|
148
|
+
test(`formatting logs as ${name}`, async () => {
|
|
146
149
|
const stream = sink()
|
|
147
150
|
const instance = pino(stream)
|
|
148
151
|
instance.level = name
|
|
149
152
|
instance[name]('hello %d', 42)
|
|
150
153
|
const result = await once(stream, 'data')
|
|
151
|
-
check(equal, result, level, 'hello 42')
|
|
154
|
+
check(assert.equal, result, level, 'hello 42')
|
|
152
155
|
})
|
|
153
156
|
|
|
154
|
-
test(`formatting a symbol at level ${name}`, async (
|
|
157
|
+
test(`formatting a symbol at level ${name}`, async () => {
|
|
155
158
|
const stream = sink()
|
|
156
159
|
const instance = pino(stream)
|
|
157
160
|
instance.level = name
|
|
@@ -161,10 +164,10 @@ function levelTest (name, level) {
|
|
|
161
164
|
|
|
162
165
|
const result = await once(stream, 'data')
|
|
163
166
|
|
|
164
|
-
check(equal, result, level, 'hello Symbol(foo)')
|
|
167
|
+
check(assert.equal, result, level, 'hello Symbol(foo)')
|
|
165
168
|
})
|
|
166
169
|
|
|
167
|
-
test(`passing error with a serializer at level ${name}`, async (
|
|
170
|
+
test(`passing error with a serializer at level ${name}`, async () => {
|
|
168
171
|
const stream = sink()
|
|
169
172
|
const err = new Error('myerror')
|
|
170
173
|
const instance = pino({
|
|
@@ -175,9 +178,9 @@ function levelTest (name, level) {
|
|
|
175
178
|
instance.level = name
|
|
176
179
|
instance[name]({ err })
|
|
177
180
|
const result = await once(stream, 'data')
|
|
178
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
181
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
179
182
|
delete result.time
|
|
180
|
-
|
|
183
|
+
assert.deepEqual(result, {
|
|
181
184
|
pid,
|
|
182
185
|
hostname,
|
|
183
186
|
level,
|
|
@@ -190,16 +193,16 @@ function levelTest (name, level) {
|
|
|
190
193
|
})
|
|
191
194
|
})
|
|
192
195
|
|
|
193
|
-
test(`child logger for level ${name}`, async (
|
|
196
|
+
test(`child logger for level ${name}`, async () => {
|
|
194
197
|
const stream = sink()
|
|
195
198
|
const instance = pino(stream)
|
|
196
199
|
instance.level = name
|
|
197
200
|
const child = instance.child({ hello: 'world' })
|
|
198
201
|
child[name]('hello world')
|
|
199
202
|
const result = await once(stream, 'data')
|
|
200
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
203
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
201
204
|
delete result.time
|
|
202
|
-
|
|
205
|
+
assert.deepEqual(result, {
|
|
203
206
|
pid,
|
|
204
207
|
hostname,
|
|
205
208
|
level,
|
|
@@ -216,7 +219,7 @@ levelTest('info', 30)
|
|
|
216
219
|
levelTest('debug', 20)
|
|
217
220
|
levelTest('trace', 10)
|
|
218
221
|
|
|
219
|
-
test('serializers can return undefined to strip field', async (
|
|
222
|
+
test('serializers can return undefined to strip field', async () => {
|
|
220
223
|
const stream = sink()
|
|
221
224
|
const instance = pino({
|
|
222
225
|
serializers: {
|
|
@@ -226,10 +229,10 @@ test('serializers can return undefined to strip field', async ({ equal }) => {
|
|
|
226
229
|
|
|
227
230
|
instance.info({ test: 'sensitive info' })
|
|
228
231
|
const result = await once(stream, 'data')
|
|
229
|
-
equal('test' in result, false)
|
|
232
|
+
assert.equal('test' in result, false)
|
|
230
233
|
})
|
|
231
234
|
|
|
232
|
-
test('streams receive a message event with PINO_CONFIG', (
|
|
235
|
+
test('streams receive a message event with PINO_CONFIG', (t, end) => {
|
|
233
236
|
const stream = sink()
|
|
234
237
|
stream.once('message', (message) => {
|
|
235
238
|
match(message, {
|
|
@@ -262,7 +265,7 @@ test('streams receive a message event with PINO_CONFIG', ({ match, end }) => {
|
|
|
262
265
|
pino(stream)
|
|
263
266
|
})
|
|
264
267
|
|
|
265
|
-
test('does not explode with a circular ref',
|
|
268
|
+
test('does not explode with a circular ref', () => {
|
|
266
269
|
const stream = sink()
|
|
267
270
|
const instance = pino(stream)
|
|
268
271
|
const b = {}
|
|
@@ -270,19 +273,19 @@ test('does not explode with a circular ref', async ({ doesNotThrow }) => {
|
|
|
270
273
|
hello: b
|
|
271
274
|
}
|
|
272
275
|
b.a = a // circular ref
|
|
273
|
-
doesNotThrow(() => instance.info(a))
|
|
276
|
+
assert.doesNotThrow(() => instance.info(a))
|
|
274
277
|
})
|
|
275
278
|
|
|
276
|
-
test('set the name', async (
|
|
279
|
+
test('set the name', async () => {
|
|
277
280
|
const stream = sink()
|
|
278
281
|
const instance = pino({
|
|
279
282
|
name: 'hello'
|
|
280
283
|
}, stream)
|
|
281
284
|
instance.fatal('this is fatal')
|
|
282
285
|
const result = await once(stream, 'data')
|
|
283
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
286
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
284
287
|
delete result.time
|
|
285
|
-
|
|
288
|
+
assert.deepEqual(result, {
|
|
286
289
|
pid,
|
|
287
290
|
hostname,
|
|
288
291
|
level: 60,
|
|
@@ -291,7 +294,7 @@ test('set the name', async ({ equal, same }) => {
|
|
|
291
294
|
})
|
|
292
295
|
})
|
|
293
296
|
|
|
294
|
-
test('set the messageKey', async (
|
|
297
|
+
test('set the messageKey', async () => {
|
|
295
298
|
const stream = sink()
|
|
296
299
|
const message = 'hello world'
|
|
297
300
|
const messageKey = 'fooMessage'
|
|
@@ -300,9 +303,9 @@ test('set the messageKey', async ({ equal, same }) => {
|
|
|
300
303
|
}, stream)
|
|
301
304
|
instance.info(message)
|
|
302
305
|
const result = await once(stream, 'data')
|
|
303
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
306
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
304
307
|
delete result.time
|
|
305
|
-
|
|
308
|
+
assert.deepEqual(result, {
|
|
306
309
|
pid,
|
|
307
310
|
hostname,
|
|
308
311
|
level: 30,
|
|
@@ -310,7 +313,7 @@ test('set the messageKey', async ({ equal, same }) => {
|
|
|
310
313
|
})
|
|
311
314
|
})
|
|
312
315
|
|
|
313
|
-
test('set the nestedKey', async (
|
|
316
|
+
test('set the nestedKey', async () => {
|
|
314
317
|
const stream = sink()
|
|
315
318
|
const object = { hello: 'world' }
|
|
316
319
|
const nestedKey = 'stuff'
|
|
@@ -319,9 +322,9 @@ test('set the nestedKey', async ({ equal, same }) => {
|
|
|
319
322
|
}, stream)
|
|
320
323
|
instance.info(object)
|
|
321
324
|
const result = await once(stream, 'data')
|
|
322
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
325
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
323
326
|
delete result.time
|
|
324
|
-
|
|
327
|
+
assert.deepEqual(result, {
|
|
325
328
|
pid,
|
|
326
329
|
hostname,
|
|
327
330
|
level: 30,
|
|
@@ -329,14 +332,14 @@ test('set the nestedKey', async ({ equal, same }) => {
|
|
|
329
332
|
})
|
|
330
333
|
})
|
|
331
334
|
|
|
332
|
-
test('set undefined properties', async (
|
|
335
|
+
test('set undefined properties', async () => {
|
|
333
336
|
const stream = sink()
|
|
334
337
|
const instance = pino(stream)
|
|
335
338
|
instance.info({ hello: 'world', property: undefined })
|
|
336
339
|
const result = await once(stream, 'data')
|
|
337
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
340
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
338
341
|
delete result.time
|
|
339
|
-
|
|
342
|
+
assert.deepEqual(result, {
|
|
340
343
|
pid,
|
|
341
344
|
hostname,
|
|
342
345
|
level: 30,
|
|
@@ -344,15 +347,15 @@ test('set undefined properties', async ({ equal, same }) => {
|
|
|
344
347
|
})
|
|
345
348
|
})
|
|
346
349
|
|
|
347
|
-
test('prototype properties are not logged', async (
|
|
350
|
+
test('prototype properties are not logged', async () => {
|
|
348
351
|
const stream = sink()
|
|
349
352
|
const instance = pino(stream)
|
|
350
353
|
instance.info(Object.create({ hello: 'world' }))
|
|
351
354
|
const { hello } = await once(stream, 'data')
|
|
352
|
-
equal(hello, undefined)
|
|
355
|
+
assert.equal(hello, undefined)
|
|
353
356
|
})
|
|
354
357
|
|
|
355
|
-
test('set the base', async (
|
|
358
|
+
test('set the base', async () => {
|
|
356
359
|
const stream = sink()
|
|
357
360
|
const instance = pino({
|
|
358
361
|
base: {
|
|
@@ -362,31 +365,31 @@ test('set the base', async ({ equal, same }) => {
|
|
|
362
365
|
|
|
363
366
|
instance.fatal('this is fatal')
|
|
364
367
|
const result = await once(stream, 'data')
|
|
365
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
368
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
366
369
|
delete result.time
|
|
367
|
-
|
|
370
|
+
assert.deepEqual(result, {
|
|
368
371
|
a: 'b',
|
|
369
372
|
level: 60,
|
|
370
373
|
msg: 'this is fatal'
|
|
371
374
|
})
|
|
372
375
|
})
|
|
373
376
|
|
|
374
|
-
test('set the base to null', async (
|
|
377
|
+
test('set the base to null', async () => {
|
|
375
378
|
const stream = sink()
|
|
376
379
|
const instance = pino({
|
|
377
380
|
base: null
|
|
378
381
|
}, stream)
|
|
379
382
|
instance.fatal('this is fatal')
|
|
380
383
|
const result = await once(stream, 'data')
|
|
381
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
384
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
382
385
|
delete result.time
|
|
383
|
-
|
|
386
|
+
assert.deepEqual(result, {
|
|
384
387
|
level: 60,
|
|
385
388
|
msg: 'this is fatal'
|
|
386
389
|
})
|
|
387
390
|
})
|
|
388
391
|
|
|
389
|
-
test('set the base to null and use a formatter', async (
|
|
392
|
+
test('set the base to null and use a formatter', async () => {
|
|
390
393
|
const stream = sink()
|
|
391
394
|
const instance = pino({
|
|
392
395
|
base: null,
|
|
@@ -398,27 +401,27 @@ test('set the base to null and use a formatter', async ({ equal, same }) => {
|
|
|
398
401
|
}, stream)
|
|
399
402
|
instance.fatal('this is fatal too')
|
|
400
403
|
const result = await once(stream, 'data')
|
|
401
|
-
equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
404
|
+
assert.equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
|
|
402
405
|
delete result.time
|
|
403
|
-
|
|
406
|
+
assert.deepEqual(result, {
|
|
404
407
|
level: 60,
|
|
405
408
|
msg: 'this is fatal too',
|
|
406
409
|
additionalMessage: 'using pino'
|
|
407
410
|
})
|
|
408
411
|
})
|
|
409
412
|
|
|
410
|
-
test('throw if creating child without bindings',
|
|
413
|
+
test('throw if creating child without bindings', () => {
|
|
411
414
|
const stream = sink()
|
|
412
415
|
const instance = pino(stream)
|
|
413
416
|
try {
|
|
414
417
|
instance.child()
|
|
415
|
-
fail('it should throw')
|
|
418
|
+
assert.fail('it should throw')
|
|
416
419
|
} catch (err) {
|
|
417
|
-
equal(err.message, 'missing bindings for child Pino')
|
|
420
|
+
assert.equal(err.message, 'missing bindings for child Pino')
|
|
418
421
|
}
|
|
419
422
|
})
|
|
420
423
|
|
|
421
|
-
test('correctly escapes msg strings with stray double quote at end', async (
|
|
424
|
+
test('correctly escapes msg strings with stray double quote at end', async () => {
|
|
422
425
|
const stream = sink()
|
|
423
426
|
const instance = pino({
|
|
424
427
|
name: 'hello'
|
|
@@ -427,7 +430,7 @@ test('correctly escapes msg strings with stray double quote at end', async ({ sa
|
|
|
427
430
|
instance.fatal('this contains "')
|
|
428
431
|
const result = await once(stream, 'data')
|
|
429
432
|
delete result.time
|
|
430
|
-
|
|
433
|
+
assert.deepEqual(result, {
|
|
431
434
|
pid,
|
|
432
435
|
hostname,
|
|
433
436
|
level: 60,
|
|
@@ -436,7 +439,7 @@ test('correctly escapes msg strings with stray double quote at end', async ({ sa
|
|
|
436
439
|
})
|
|
437
440
|
})
|
|
438
441
|
|
|
439
|
-
test('correctly escape msg strings with unclosed double quote', async (
|
|
442
|
+
test('correctly escape msg strings with unclosed double quote', async () => {
|
|
440
443
|
const stream = sink()
|
|
441
444
|
const instance = pino({
|
|
442
445
|
name: 'hello'
|
|
@@ -444,7 +447,7 @@ test('correctly escape msg strings with unclosed double quote', async ({ same })
|
|
|
444
447
|
instance.fatal('" this contains')
|
|
445
448
|
const result = await once(stream, 'data')
|
|
446
449
|
delete result.time
|
|
447
|
-
|
|
450
|
+
assert.deepEqual(result, {
|
|
448
451
|
pid,
|
|
449
452
|
hostname,
|
|
450
453
|
level: 60,
|
|
@@ -453,32 +456,32 @@ test('correctly escape msg strings with unclosed double quote', async ({ same })
|
|
|
453
456
|
})
|
|
454
457
|
})
|
|
455
458
|
|
|
456
|
-
test('correctly escape quote in a key', async (
|
|
459
|
+
test('correctly escape quote in a key', async () => {
|
|
457
460
|
const stream = sink()
|
|
458
461
|
const instance = pino(stream)
|
|
459
462
|
const obj = { 'some"obj': 'world' }
|
|
460
463
|
instance.info(obj, 'a string')
|
|
461
464
|
const result = await once(stream, 'data')
|
|
462
465
|
delete result.time
|
|
463
|
-
|
|
466
|
+
assert.deepEqual(result, {
|
|
464
467
|
level: 30,
|
|
465
468
|
pid,
|
|
466
469
|
hostname,
|
|
467
470
|
msg: 'a string',
|
|
468
471
|
'some"obj': 'world'
|
|
469
472
|
})
|
|
470
|
-
|
|
473
|
+
assert.deepEqual(Object.keys(obj), ['some"obj'])
|
|
471
474
|
})
|
|
472
475
|
|
|
473
476
|
// https://github.com/pinojs/pino/issues/139
|
|
474
|
-
test('object and format string', async (
|
|
477
|
+
test('object and format string', async () => {
|
|
475
478
|
const stream = sink()
|
|
476
479
|
const instance = pino(stream)
|
|
477
480
|
instance.info({}, 'foo %s', 'bar')
|
|
478
481
|
|
|
479
482
|
const result = await once(stream, 'data')
|
|
480
483
|
delete result.time
|
|
481
|
-
|
|
484
|
+
assert.deepEqual(result, {
|
|
482
485
|
pid,
|
|
483
486
|
hostname,
|
|
484
487
|
level: 30,
|
|
@@ -486,13 +489,13 @@ test('object and format string', async ({ same }) => {
|
|
|
486
489
|
})
|
|
487
490
|
})
|
|
488
491
|
|
|
489
|
-
test('object and format string property', async (
|
|
492
|
+
test('object and format string property', async () => {
|
|
490
493
|
const stream = sink()
|
|
491
494
|
const instance = pino(stream)
|
|
492
495
|
instance.info({ answer: 42 }, 'foo %s', 'bar')
|
|
493
496
|
const result = await once(stream, 'data')
|
|
494
497
|
delete result.time
|
|
495
|
-
|
|
498
|
+
assert.deepEqual(result, {
|
|
496
499
|
pid,
|
|
497
500
|
hostname,
|
|
498
501
|
level: 30,
|
|
@@ -501,42 +504,43 @@ test('object and format string property', async ({ same }) => {
|
|
|
501
504
|
})
|
|
502
505
|
})
|
|
503
506
|
|
|
504
|
-
test('correctly strip undefined when returned from toJSON', async (
|
|
507
|
+
test('correctly strip undefined when returned from toJSON', async () => {
|
|
505
508
|
const stream = sink()
|
|
506
509
|
const instance = pino({
|
|
507
510
|
test: 'this'
|
|
508
511
|
}, stream)
|
|
509
512
|
instance.fatal({ test: { toJSON () { return undefined } } })
|
|
510
513
|
const result = await once(stream, 'data')
|
|
511
|
-
equal('test' in result, false)
|
|
514
|
+
assert.equal('test' in result, false)
|
|
512
515
|
})
|
|
513
516
|
|
|
514
|
-
test('correctly supports stderr',
|
|
517
|
+
test('correctly supports stderr', (t, end) => {
|
|
515
518
|
// stderr inherits from Stream, rather than Writable
|
|
516
519
|
const dest = {
|
|
517
520
|
writable: true,
|
|
518
521
|
write (result) {
|
|
519
522
|
result = JSON.parse(result)
|
|
520
523
|
delete result.time
|
|
521
|
-
|
|
524
|
+
assert.deepEqual(result, {
|
|
522
525
|
pid,
|
|
523
526
|
hostname,
|
|
524
527
|
level: 60,
|
|
525
528
|
msg: 'a message'
|
|
526
529
|
})
|
|
530
|
+
end()
|
|
527
531
|
}
|
|
528
532
|
}
|
|
529
533
|
const instance = pino(dest)
|
|
530
534
|
instance.fatal('a message')
|
|
531
535
|
})
|
|
532
536
|
|
|
533
|
-
test('normalize number to string', async (
|
|
537
|
+
test('normalize number to string', async () => {
|
|
534
538
|
const stream = sink()
|
|
535
539
|
const instance = pino(stream)
|
|
536
540
|
instance.info(1)
|
|
537
541
|
const result = await once(stream, 'data')
|
|
538
542
|
delete result.time
|
|
539
|
-
|
|
543
|
+
assert.deepEqual(result, {
|
|
540
544
|
pid,
|
|
541
545
|
hostname,
|
|
542
546
|
level: 30,
|
|
@@ -544,13 +548,13 @@ test('normalize number to string', async ({ same }) => {
|
|
|
544
548
|
})
|
|
545
549
|
})
|
|
546
550
|
|
|
547
|
-
test('normalize number to string with an object', async (
|
|
551
|
+
test('normalize number to string with an object', async () => {
|
|
548
552
|
const stream = sink()
|
|
549
553
|
const instance = pino(stream)
|
|
550
554
|
instance.info({ answer: 42 }, 1)
|
|
551
555
|
const result = await once(stream, 'data')
|
|
552
556
|
delete result.time
|
|
553
|
-
|
|
557
|
+
assert.deepEqual(result, {
|
|
554
558
|
pid,
|
|
555
559
|
hostname,
|
|
556
560
|
level: 30,
|
|
@@ -559,7 +563,7 @@ test('normalize number to string with an object', async ({ same }) => {
|
|
|
559
563
|
})
|
|
560
564
|
})
|
|
561
565
|
|
|
562
|
-
test('handles objects with null prototype', async (
|
|
566
|
+
test('handles objects with null prototype', async () => {
|
|
563
567
|
const stream = sink()
|
|
564
568
|
const instance = pino(stream)
|
|
565
569
|
const o = Object.create(null)
|
|
@@ -567,7 +571,7 @@ test('handles objects with null prototype', async ({ same }) => {
|
|
|
567
571
|
instance.info(o)
|
|
568
572
|
const result = await once(stream, 'data')
|
|
569
573
|
delete result.time
|
|
570
|
-
|
|
574
|
+
assert.deepEqual(result, {
|
|
571
575
|
pid,
|
|
572
576
|
hostname,
|
|
573
577
|
level: 30,
|
|
@@ -575,14 +579,14 @@ test('handles objects with null prototype', async ({ same }) => {
|
|
|
575
579
|
})
|
|
576
580
|
})
|
|
577
581
|
|
|
578
|
-
test('pino.destination', async (
|
|
582
|
+
test('pino.destination', async () => {
|
|
579
583
|
const tmp = file()
|
|
580
584
|
const instance = pino(pino.destination(tmp))
|
|
581
585
|
instance.info('hello')
|
|
582
586
|
await watchFileCreated(tmp)
|
|
583
587
|
const result = JSON.parse(readFileSync(tmp).toString())
|
|
584
588
|
delete result.time
|
|
585
|
-
|
|
589
|
+
assert.deepEqual(result, {
|
|
586
590
|
pid,
|
|
587
591
|
hostname,
|
|
588
592
|
level: 30,
|
|
@@ -590,14 +594,14 @@ test('pino.destination', async ({ same }) => {
|
|
|
590
594
|
})
|
|
591
595
|
})
|
|
592
596
|
|
|
593
|
-
test('auto pino.destination with a string', async (
|
|
597
|
+
test('auto pino.destination with a string', async () => {
|
|
594
598
|
const tmp = file()
|
|
595
599
|
const instance = pino(tmp)
|
|
596
600
|
instance.info('hello')
|
|
597
601
|
await watchFileCreated(tmp)
|
|
598
602
|
const result = JSON.parse(readFileSync(tmp).toString())
|
|
599
603
|
delete result.time
|
|
600
|
-
|
|
604
|
+
assert.deepEqual(result, {
|
|
601
605
|
pid,
|
|
602
606
|
hostname,
|
|
603
607
|
level: 30,
|
|
@@ -605,14 +609,14 @@ test('auto pino.destination with a string', async ({ same }) => {
|
|
|
605
609
|
})
|
|
606
610
|
})
|
|
607
611
|
|
|
608
|
-
test('auto pino.destination with a string as second argument', async (
|
|
612
|
+
test('auto pino.destination with a string as second argument', async () => {
|
|
609
613
|
const tmp = file()
|
|
610
614
|
const instance = pino(null, tmp)
|
|
611
615
|
instance.info('hello')
|
|
612
616
|
await watchFileCreated(tmp)
|
|
613
617
|
const result = JSON.parse(readFileSync(tmp).toString())
|
|
614
618
|
delete result.time
|
|
615
|
-
|
|
619
|
+
assert.deepEqual(result, {
|
|
616
620
|
pid,
|
|
617
621
|
hostname,
|
|
618
622
|
level: 30,
|
|
@@ -620,7 +624,7 @@ test('auto pino.destination with a string as second argument', async ({ same })
|
|
|
620
624
|
})
|
|
621
625
|
})
|
|
622
626
|
|
|
623
|
-
test('does not override opts with a string as second argument', async (
|
|
627
|
+
test('does not override opts with a string as second argument', async () => {
|
|
624
628
|
const tmp = file()
|
|
625
629
|
const instance = pino({
|
|
626
630
|
timestamp: () => ',"time":"none"'
|
|
@@ -628,7 +632,7 @@ test('does not override opts with a string as second argument', async ({ same })
|
|
|
628
632
|
instance.info('hello')
|
|
629
633
|
await watchFileCreated(tmp)
|
|
630
634
|
const result = JSON.parse(readFileSync(tmp).toString())
|
|
631
|
-
|
|
635
|
+
assert.deepEqual(result, {
|
|
632
636
|
pid,
|
|
633
637
|
hostname,
|
|
634
638
|
level: 30,
|
|
@@ -638,15 +642,15 @@ test('does not override opts with a string as second argument', async ({ same })
|
|
|
638
642
|
})
|
|
639
643
|
|
|
640
644
|
// https://github.com/pinojs/pino/issues/222
|
|
641
|
-
test('children with same names render in correct order', async (
|
|
645
|
+
test('children with same names render in correct order', async () => {
|
|
642
646
|
const stream = sink()
|
|
643
647
|
const root = pino(stream)
|
|
644
648
|
root.child({ a: 1 }).child({ a: 2 }).info({ a: 3 })
|
|
645
649
|
const { a } = await once(stream, 'data')
|
|
646
|
-
equal(a, 3, 'last logged object takes precedence')
|
|
650
|
+
assert.equal(a, 3, 'last logged object takes precedence')
|
|
647
651
|
})
|
|
648
652
|
|
|
649
|
-
test('use `safe-stable-stringify` to avoid circular dependencies', async (
|
|
653
|
+
test('use `safe-stable-stringify` to avoid circular dependencies', async () => {
|
|
650
654
|
const stream = sink()
|
|
651
655
|
const root = pino(stream)
|
|
652
656
|
// circular depth
|
|
@@ -654,10 +658,10 @@ test('use `safe-stable-stringify` to avoid circular dependencies', async ({ same
|
|
|
654
658
|
obj.a = obj
|
|
655
659
|
root.info(obj)
|
|
656
660
|
const { a } = await once(stream, 'data')
|
|
657
|
-
|
|
661
|
+
assert.deepEqual(a, { a: '[Circular]' })
|
|
658
662
|
})
|
|
659
663
|
|
|
660
|
-
test('correctly log non circular objects', async (
|
|
664
|
+
test('correctly log non circular objects', async () => {
|
|
661
665
|
const stream = sink()
|
|
662
666
|
const root = pino(stream)
|
|
663
667
|
const obj = {}
|
|
@@ -668,10 +672,10 @@ test('correctly log non circular objects', async ({ same }) => {
|
|
|
668
672
|
}
|
|
669
673
|
root.info(obj)
|
|
670
674
|
const { node } = await once(stream, 'data')
|
|
671
|
-
|
|
675
|
+
assert.deepEqual(node, { node: { node: { node: { node: { node: { node: { node: { node: { node: {} } } } } } } } } })
|
|
672
676
|
})
|
|
673
677
|
|
|
674
|
-
test('safe-stable-stringify must be used when interpolating', async (
|
|
678
|
+
test('safe-stable-stringify must be used when interpolating', async () => {
|
|
675
679
|
const stream = sink()
|
|
676
680
|
const instance = pino(stream)
|
|
677
681
|
|
|
@@ -680,18 +684,21 @@ test('safe-stable-stringify must be used when interpolating', async (t) => {
|
|
|
680
684
|
instance.info('test %j', o)
|
|
681
685
|
|
|
682
686
|
const { msg } = await once(stream, 'data')
|
|
683
|
-
|
|
687
|
+
assert.equal(msg, 'test {"a":{"b":{"c":"[Circular]"}}}')
|
|
684
688
|
})
|
|
685
689
|
|
|
686
|
-
test('throws when setting useOnlyCustomLevels without customLevels',
|
|
687
|
-
throws(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
test('throws when setting useOnlyCustomLevels without customLevels', () => {
|
|
691
|
+
assert.throws(
|
|
692
|
+
() => {
|
|
693
|
+
pino({
|
|
694
|
+
useOnlyCustomLevels: true
|
|
695
|
+
})
|
|
696
|
+
},
|
|
697
|
+
/customLevels is required if useOnlyCustomLevels is set true/
|
|
698
|
+
)
|
|
692
699
|
})
|
|
693
700
|
|
|
694
|
-
test('correctly log Infinity', async (
|
|
701
|
+
test('correctly log Infinity', async () => {
|
|
695
702
|
const stream = sink()
|
|
696
703
|
const instance = pino(stream)
|
|
697
704
|
|
|
@@ -699,10 +706,10 @@ test('correctly log Infinity', async (t) => {
|
|
|
699
706
|
instance.info(o)
|
|
700
707
|
|
|
701
708
|
const { num } = await once(stream, 'data')
|
|
702
|
-
|
|
709
|
+
assert.equal(num, null)
|
|
703
710
|
})
|
|
704
711
|
|
|
705
|
-
test('correctly log -Infinity', async (
|
|
712
|
+
test('correctly log -Infinity', async () => {
|
|
706
713
|
const stream = sink()
|
|
707
714
|
const instance = pino(stream)
|
|
708
715
|
|
|
@@ -710,10 +717,10 @@ test('correctly log -Infinity', async (t) => {
|
|
|
710
717
|
instance.info(o)
|
|
711
718
|
|
|
712
719
|
const { num } = await once(stream, 'data')
|
|
713
|
-
|
|
720
|
+
assert.equal(num, null)
|
|
714
721
|
})
|
|
715
722
|
|
|
716
|
-
test('correctly log NaN', async (
|
|
723
|
+
test('correctly log NaN', async () => {
|
|
717
724
|
const stream = sink()
|
|
718
725
|
const instance = pino(stream)
|
|
719
726
|
|
|
@@ -721,19 +728,19 @@ test('correctly log NaN', async (t) => {
|
|
|
721
728
|
instance.info(o)
|
|
722
729
|
|
|
723
730
|
const { num } = await once(stream, 'data')
|
|
724
|
-
|
|
731
|
+
assert.equal(num, null)
|
|
725
732
|
})
|
|
726
733
|
|
|
727
|
-
test('offers a .default() method to please typescript', async (
|
|
728
|
-
equal(pino.default, pino)
|
|
734
|
+
test('offers a .default() method to please typescript', async () => {
|
|
735
|
+
assert.equal(pino.default, pino)
|
|
729
736
|
|
|
730
737
|
const stream = sink()
|
|
731
738
|
const instance = pino.default(stream)
|
|
732
739
|
instance.info('hello world')
|
|
733
|
-
check(equal, await once(stream, 'data'), 30, 'hello world')
|
|
740
|
+
check(assert.equal, await once(stream, 'data'), 30, 'hello world')
|
|
734
741
|
})
|
|
735
742
|
|
|
736
|
-
test('correctly skip function', async (
|
|
743
|
+
test('correctly skip function', async () => {
|
|
737
744
|
const stream = sink()
|
|
738
745
|
const instance = pino(stream)
|
|
739
746
|
|
|
@@ -741,10 +748,10 @@ test('correctly skip function', async (t) => {
|
|
|
741
748
|
instance.info(o, () => {})
|
|
742
749
|
|
|
743
750
|
const { msg } = await once(stream, 'data')
|
|
744
|
-
|
|
751
|
+
assert.equal(msg, undefined)
|
|
745
752
|
})
|
|
746
753
|
|
|
747
|
-
test('correctly skip Infinity', async (
|
|
754
|
+
test('correctly skip Infinity', async () => {
|
|
748
755
|
const stream = sink()
|
|
749
756
|
const instance = pino(stream)
|
|
750
757
|
|
|
@@ -752,10 +759,10 @@ test('correctly skip Infinity', async (t) => {
|
|
|
752
759
|
instance.info(o, Infinity)
|
|
753
760
|
|
|
754
761
|
const { msg } = await once(stream, 'data')
|
|
755
|
-
|
|
762
|
+
assert.equal(msg, null)
|
|
756
763
|
})
|
|
757
764
|
|
|
758
|
-
test('correctly log number', async (
|
|
765
|
+
test('correctly log number', async () => {
|
|
759
766
|
const stream = sink()
|
|
760
767
|
const instance = pino(stream)
|
|
761
768
|
|
|
@@ -763,10 +770,10 @@ test('correctly log number', async (t) => {
|
|
|
763
770
|
instance.info(o, 42)
|
|
764
771
|
|
|
765
772
|
const { msg } = await once(stream, 'data')
|
|
766
|
-
|
|
773
|
+
assert.equal(msg, 42)
|
|
767
774
|
})
|
|
768
775
|
|
|
769
|
-
test('nestedKey should not be used for non-objects', async (
|
|
776
|
+
test('nestedKey should not be used for non-objects', async () => {
|
|
770
777
|
const stream = sink()
|
|
771
778
|
const message = 'hello'
|
|
772
779
|
const nestedKey = 'stuff'
|
|
@@ -776,7 +783,7 @@ test('nestedKey should not be used for non-objects', async ({ strictSame }) => {
|
|
|
776
783
|
instance.info(message)
|
|
777
784
|
const result = await once(stream, 'data')
|
|
778
785
|
delete result.time
|
|
779
|
-
|
|
786
|
+
assert.deepStrictEqual(result, {
|
|
780
787
|
pid,
|
|
781
788
|
hostname,
|
|
782
789
|
level: 30,
|
|
@@ -784,75 +791,80 @@ test('nestedKey should not be used for non-objects', async ({ strictSame }) => {
|
|
|
784
791
|
})
|
|
785
792
|
})
|
|
786
793
|
|
|
787
|
-
test('throws if prettyPrint is passed in as an option', async (
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
794
|
+
test('throws if prettyPrint is passed in as an option', async () => {
|
|
795
|
+
assert.throws(
|
|
796
|
+
() => {
|
|
797
|
+
pino({
|
|
798
|
+
prettyPrint: true
|
|
799
|
+
})
|
|
800
|
+
},
|
|
801
|
+
Error('prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)')
|
|
802
|
+
)
|
|
793
803
|
})
|
|
794
804
|
|
|
795
|
-
test('Should invoke `onChild` with the newly created child',
|
|
805
|
+
test('Should invoke `onChild` with the newly created child', () => {
|
|
796
806
|
let innerChild
|
|
797
807
|
const child = pino({
|
|
798
808
|
onChild: (instance) => {
|
|
799
809
|
innerChild = instance
|
|
800
810
|
}
|
|
801
811
|
}).child({ foo: 'bar' })
|
|
802
|
-
equal(child, innerChild)
|
|
812
|
+
assert.equal(child, innerChild)
|
|
803
813
|
})
|
|
804
814
|
|
|
805
|
-
test('logger message should have the prefix message that defined in the logger creation', async (
|
|
815
|
+
test('logger message should have the prefix message that defined in the logger creation', async () => {
|
|
806
816
|
const stream = sink()
|
|
807
817
|
const logger = pino({
|
|
808
818
|
msgPrefix: 'My name is Bond '
|
|
809
819
|
}, stream)
|
|
820
|
+
assert.equal(logger.msgPrefix, 'My name is Bond ')
|
|
810
821
|
logger.info('James Bond')
|
|
811
822
|
const { msg } = await once(stream, 'data')
|
|
812
|
-
equal(msg, 'My name is Bond James Bond')
|
|
823
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
813
824
|
})
|
|
814
825
|
|
|
815
|
-
test('child message should have the prefix message that defined in the child creation', async (
|
|
826
|
+
test('child message should have the prefix message that defined in the child creation', async () => {
|
|
816
827
|
const stream = sink()
|
|
817
828
|
const instance = pino(stream)
|
|
818
829
|
const child = instance.child({}, { msgPrefix: 'My name is Bond ' })
|
|
819
830
|
child.info('James Bond')
|
|
820
831
|
const { msg } = await once(stream, 'data')
|
|
821
|
-
equal(msg, 'My name is Bond James Bond')
|
|
832
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
822
833
|
})
|
|
823
834
|
|
|
824
|
-
test('child message should have the prefix message that defined in the child creation when logging with log meta', async (
|
|
835
|
+
test('child message should have the prefix message that defined in the child creation when logging with log meta', async () => {
|
|
825
836
|
const stream = sink()
|
|
826
837
|
const instance = pino(stream)
|
|
827
838
|
const child = instance.child({}, { msgPrefix: 'My name is Bond ' })
|
|
828
839
|
child.info({ hello: 'world' }, 'James Bond')
|
|
829
840
|
const { msg, hello } = await once(stream, 'data')
|
|
830
|
-
equal(hello, 'world')
|
|
831
|
-
equal(msg, 'My name is Bond James Bond')
|
|
841
|
+
assert.equal(hello, 'world')
|
|
842
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
832
843
|
})
|
|
833
844
|
|
|
834
|
-
test('logged message should not have the prefix when not providing any message', async (
|
|
845
|
+
test('logged message should not have the prefix when not providing any message', async () => {
|
|
835
846
|
const stream = sink()
|
|
836
847
|
const instance = pino(stream)
|
|
837
848
|
const child = instance.child({}, { msgPrefix: 'This should not be shown ' })
|
|
838
849
|
child.info({ hello: 'world' })
|
|
839
850
|
const { msg, hello } = await once(stream, 'data')
|
|
840
|
-
equal(hello, 'world')
|
|
841
|
-
equal(msg, undefined)
|
|
851
|
+
assert.equal(hello, 'world')
|
|
852
|
+
assert.equal(msg, undefined)
|
|
842
853
|
})
|
|
843
854
|
|
|
844
|
-
test('child message should append parent prefix to current prefix that defined in the child creation', async (
|
|
855
|
+
test('child message should append parent prefix to current prefix that defined in the child creation', async () => {
|
|
845
856
|
const stream = sink()
|
|
846
857
|
const instance = pino({
|
|
847
858
|
msgPrefix: 'My name is Bond '
|
|
848
859
|
}, stream)
|
|
849
860
|
const child = instance.child({}, { msgPrefix: 'James ' })
|
|
850
861
|
child.info('Bond')
|
|
862
|
+
assert.equal(child.msgPrefix, 'My name is Bond James ')
|
|
851
863
|
const { msg } = await once(stream, 'data')
|
|
852
|
-
equal(msg, 'My name is Bond James Bond')
|
|
864
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
853
865
|
})
|
|
854
866
|
|
|
855
|
-
test('child message should inherent parent prefix', async (
|
|
867
|
+
test('child message should inherent parent prefix', async () => {
|
|
856
868
|
const stream = sink()
|
|
857
869
|
const instance = pino({
|
|
858
870
|
msgPrefix: 'My name is Bond '
|
|
@@ -860,15 +872,15 @@ test('child message should inherent parent prefix', async ({ equal }) => {
|
|
|
860
872
|
const child = instance.child({})
|
|
861
873
|
child.info('James Bond')
|
|
862
874
|
const { msg } = await once(stream, 'data')
|
|
863
|
-
equal(msg, 'My name is Bond James Bond')
|
|
875
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
864
876
|
})
|
|
865
877
|
|
|
866
|
-
test('grandchild message should inherent parent prefix', async (
|
|
878
|
+
test('grandchild message should inherent parent prefix', async () => {
|
|
867
879
|
const stream = sink()
|
|
868
880
|
const instance = pino(stream)
|
|
869
881
|
const child = instance.child({}, { msgPrefix: 'My name is Bond ' })
|
|
870
882
|
const grandchild = child.child({})
|
|
871
883
|
grandchild.info('James Bond')
|
|
872
884
|
const { msg } = await once(stream, 'data')
|
|
873
|
-
equal(msg, 'My name is Bond James Bond')
|
|
885
|
+
assert.equal(msg, 'My name is Bond James Bond')
|
|
874
886
|
})
|