@zuplo/cli 7.0.2 → 7.1.1
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/dist/delete/handler.js +2 -2
- package/dist/delete/handler.js.map +1 -1
- package/dist/deploy/handler.js +1 -1
- package/dist/deploy/handler.js.map +1 -1
- package/dist/deploy/poll-deployment.js +1 -1
- package/dist/deploy/poll-deployment.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@pinojs/redact/.github/dependabot.yml +13 -0
- 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/{event-target-shim → @pinojs/redact}/LICENSE +2 -3
- 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/@zuplo/core/customer.cli.minified.js +240 -240
- package/node_modules/@zuplo/core/index.minified.js +258 -258
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/{abort-controller → @zuplo/editor/node_modules/fast-copy}/LICENSE +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-copy/README.md +395 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/cjs/index.cjs +406 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/umd/index.js +412 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/dist/umd/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/index.d.ts +55 -0
- package/node_modules/@zuplo/editor/node_modules/fast-copy/package.json +103 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/.github/workflows/ci.yml +97 -0
- package/node_modules/{fast-redact → @zuplo/editor/node_modules/pino-abstract-transport}/LICENSE +3 -3
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/README.md +172 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/index.d.ts +122 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/index.js +128 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/package.json +40 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/base.test.js +445 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-async-iteration.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-on-data.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/transport-transform.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/fixtures/worker-pipeline.js +15 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/types/index.test-d.ts +31 -0
- package/node_modules/@zuplo/editor/node_modules/pino-abstract-transport/test/worker.test.js +357 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.airtap.yml +7 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/dependabot.yml +13 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/stale.yml +21 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/.github/workflows/ci.yml +137 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/README.md +126 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/ignore.js +35 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/no__proto__.js +40 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/package.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/remove.js +39 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/throw.js +49 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/benchmarks/valid.js +49 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/index.js +126 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/package.json +41 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/test/index.test.js +505 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/types/index.d.ts +57 -0
- package/node_modules/@zuplo/editor/node_modules/secure-json-parse/types/index.test-d.ts +31 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/index.d.ts +36 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/index.js +77 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/license +9 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/package.json +47 -0
- package/node_modules/@zuplo/editor/node_modules/strip-json-comments/readme.md +78 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.claude/settings.local.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.github/dependabot.yml +13 -0
- package/node_modules/{pino → @zuplo/editor/node_modules/thread-stream}/.github/workflows/ci.yml +25 -19
- package/node_modules/@zuplo/editor/node_modules/thread-stream/.husky/pre-commit +4 -0
- package/node_modules/@zuplo/editor/node_modules/{process-warning → thread-stream}/LICENSE +1 -1
- package/node_modules/@zuplo/editor/node_modules/thread-stream/README.md +136 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/bench.js +85 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/index.d.ts +92 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/index.js +565 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/indexes.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/wait.js +61 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/lib/worker.js +186 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/package.json +57 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/base.test.js +258 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/bench.test.js +38 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/bundlers.test.js +60 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/close-on-gc.js +37 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/commonjs-fallback.test.js +80 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/context.test.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/create-and-exit.js +16 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/custom-worker.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/dir with spaces/test-package.zip +0 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/emit-event.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/end.test.js +61 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/error.js +14 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/esm.test.mjs +47 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/event.test.js +23 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/exit.js +14 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/get-context.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/helper.d.ts +1 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/helper.js +35 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/indexes.test.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/message-without-code.js +19 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/multibyte-chars.test.mjs +74 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/on-message.js +18 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/index.js +37 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/pkg.config.json +15 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/pkg/pkg.test.js +46 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/port.js +16 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/post-message.test.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/string-limit-2.test.js +41 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/string-limit.test.js +42 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/syntax-error.mjs +2 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/thread-management.test.js +121 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file-on-destroy.js +23 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file-on-final.js +24 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file.js +12 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-file.mjs +8 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/to-next.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/transpiled.test.js +30 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts/to-file.ts +10 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts/transpile.sh +19 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/ts-commonjs-default-export.zip +0 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/uncaughtException.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/unhandledRejection.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/watch-mode.test.js +28 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/test/yarnrc.yml +7 -0
- package/node_modules/@zuplo/editor/node_modules/thread-stream/tsconfig.json +8 -0
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-XLNOQPTE.js → chunk-RS7HF7BL.js} +63 -63
- package/node_modules/@zuplo/runtime/out/esm/chunk-RS7HF7BL.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +16 -19
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mcp/messages/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/mocks/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/out/types/sdks/aws/index.d.ts +1 -2
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/fast-copy/LICENSE +1 -1
- package/node_modules/fast-copy/README.md +186 -154
- package/node_modules/fast-copy/dist/cjs/index.cjs +143 -214
- package/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -1
- package/node_modules/fast-copy/dist/cjs/index.d.cts +54 -0
- package/node_modules/fast-copy/dist/es/index.d.mts +54 -0
- package/node_modules/fast-copy/dist/es/index.mjs +331 -0
- package/node_modules/fast-copy/dist/es/index.mjs.map +1 -0
- package/node_modules/fast-copy/dist/umd/index.d.ts +54 -0
- package/node_modules/fast-copy/dist/umd/index.js +143 -214
- package/node_modules/fast-copy/dist/umd/index.js.map +1 -1
- package/node_modules/fast-copy/index.d.ts +37 -38
- package/node_modules/fast-copy/package.json +68 -61
- package/node_modules/pino/CONTRIBUTING.md +4 -4
- package/node_modules/pino/LICENSE +1 -1
- package/node_modules/pino/README.md +18 -2
- package/node_modules/pino/SECURITY.md +19 -0
- package/node_modules/pino/browser.js +76 -13
- package/node_modules/pino/build/sync-version.js +16 -1
- package/node_modules/pino/docs/api.md +128 -5
- package/node_modules/pino/docs/browser.md +51 -0
- 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 +28 -2
- package/node_modules/pino/docs/transports.md +188 -20
- package/node_modules/pino/docs/web.md +40 -0
- package/node_modules/pino/eslint.config.js +28 -0
- 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 +34 -10
- 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 +42 -9
- package/node_modules/pino/lib/transport.js +125 -3
- package/node_modules/pino/package.json +25 -25
- package/node_modules/pino/pino.d.ts +228 -203
- package/node_modules/pino/pino.js +2 -1
- package/node_modules/pino/test/basic.test.js +179 -167
- package/node_modules/pino/test/broken-pipe.test.js +16 -14
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser.test.js +39 -0
- 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 +47 -42
- package/node_modules/pino/test/escaping.test.js +7 -5
- 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 +8 -6
- package/node_modules/pino/test/exit.test.js +17 -15
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +1 -1
- package/node_modules/pino/test/formatters.test.js +43 -34
- package/node_modules/pino/test/helper.d.ts +3 -3
- package/node_modules/pino/test/helper.js +36 -9
- package/node_modules/pino/test/hooks.test.js +45 -28
- package/node_modules/pino/test/http.test.js +38 -66
- package/node_modules/pino/test/internals/version.test.js +9 -7
- package/node_modules/pino/test/is-level-enabled.test.js +66 -72
- package/node_modules/pino/test/levels.test.js +191 -153
- package/node_modules/pino/test/metadata.test.js +44 -30
- package/node_modules/pino/test/mixin-merge-strategy.test.js +9 -7
- package/node_modules/pino/test/mixin.test.js +62 -39
- package/node_modules/pino/test/multistream.test.js +173 -117
- 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 +12 -10
- package/node_modules/pino/test/syncfalse.test.js +24 -26
- 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 +8 -9
- package/node_modules/pino/test/transport/bundlers-support.test.js +12 -10
- package/node_modules/pino/test/transport/caller.test.js +8 -7
- package/node_modules/pino/test/transport/core.test.js +232 -143
- package/node_modules/pino/test/transport/core.transpiled.test.ts +15 -13
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +17 -15
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +14 -12
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +4 -3
- package/node_modules/pino/test/transport/{syncfalse.test.js → sync-false.test.js} +15 -16
- package/node_modules/pino/test/transport/{syncTrue.test.js → sync-true.test.js} +6 -4
- package/node_modules/pino/test/transport/targets.test.js +13 -9
- package/node_modules/pino/test/transport/uses-pino-config.test.js +13 -14
- package/node_modules/pino/test/transport-stream.test.js +22 -8
- 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 +4 -4
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +26 -27
- package/node_modules/pino/test/types/pino-transport.test-d.ts +99 -88
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +55 -44
- package/node_modules/pino/test/types/pino.test-d.ts +500 -281
- package/node_modules/pino/test/types/pino.ts +50 -37
- package/node_modules/pino/tsconfig.json +1 -1
- package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +5 -22
- package/node_modules/pino-abstract-transport/README.md +0 -1
- package/node_modules/pino-abstract-transport/package.json +6 -5
- package/node_modules/pino-abstract-transport/test/base.test.js +108 -80
- package/node_modules/pino-abstract-transport/test/match.js +24 -0
- package/node_modules/pino-abstract-transport/test/worker.test.js +46 -31
- package/node_modules/pino-pretty/.borp.yaml +6 -0
- package/node_modules/pino-pretty/.github/dependabot.yml +1 -1
- package/node_modules/pino-pretty/.github/workflows/ci.yml +5 -12
- package/node_modules/pino-pretty/Readme.md +24 -3
- package/node_modules/pino-pretty/bin.js +5 -4
- package/node_modules/pino-pretty/eslint.config.js +3 -0
- package/node_modules/pino-pretty/index.d.ts +7 -7
- package/node_modules/pino-pretty/index.js +1 -1
- package/node_modules/pino-pretty/lib/colors.js +9 -4
- package/node_modules/pino-pretty/lib/colors.test.js +36 -36
- package/node_modules/pino-pretty/lib/pretty.js +7 -5
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +2 -4
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +17 -19
- package/node_modules/pino-pretty/lib/utils/create-date.test.js +7 -7
- package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +7 -7
- package/node_modules/pino-pretty/lib/utils/filter-log.test.js +33 -40
- package/node_modules/pino-pretty/lib/utils/format-time.js +1 -1
- package/node_modules/pino-pretty/lib/utils/format-time.test.js +25 -25
- package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +11 -11
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +15 -14
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +11 -11
- package/node_modules/pino-pretty/lib/utils/index.test.js +8 -8
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +23 -23
- package/node_modules/pino-pretty/lib/utils/is-object.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +6 -6
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/noop.test.js +5 -5
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +26 -26
- package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +3 -4
- package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +9 -9
- package/node_modules/pino-pretty/lib/utils/prettify-message.js +2 -1
- package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +73 -41
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +37 -37
- package/node_modules/pino-pretty/lib/utils/prettify-object.js +1 -1
- package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +71 -32
- package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +29 -29
- package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +11 -11
- package/node_modules/pino-pretty/package.json +22 -24
- package/node_modules/pino-pretty/test/basic.test.js +190 -181
- package/node_modules/pino-pretty/test/cli-rc.test.js +93 -73
- package/node_modules/pino-pretty/test/cli.test.js +169 -144
- package/node_modules/pino-pretty/test/crlf.test.js +6 -8
- package/node_modules/pino-pretty/test/error-objects.test.js +85 -90
- package/node_modules/pino-pretty/test/example/example.js +3 -1
- package/node_modules/pino-pretty/test/helper.js +19 -0
- package/node_modules/pino-pretty/test/types/pino-pretty.test-d.ts +4 -1
- package/node_modules/process-warning/.github/dependabot.yml +41 -1
- package/node_modules/process-warning/.github/workflows/ci.yml +12 -3
- package/node_modules/process-warning/LICENSE +1 -1
- package/node_modules/process-warning/README.md +42 -3
- package/node_modules/process-warning/index.js +85 -17
- package/node_modules/process-warning/package.json +7 -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 +14 -9
- package/node_modules/process-warning/test/emit-reset.test.js +14 -10
- package/node_modules/process-warning/test/emit-set.test.js +10 -5
- package/node_modules/process-warning/test/emit-unlimited.test.js +14 -9
- 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 +7 -7
- package/node_modules/process-warning/types/index.d.ts +15 -1
- package/node_modules/secure-json-parse/.github/dependabot.yml +1 -1
- package/node_modules/secure-json-parse/.github/workflows/ci.yml +31 -19
- package/node_modules/{ieee754 → secure-json-parse}/LICENSE +9 -1
- package/node_modules/secure-json-parse/README.md +14 -8
- package/node_modules/secure-json-parse/benchmarks/ignore.js +1 -1
- package/node_modules/secure-json-parse/benchmarks/throw.js +3 -3
- package/node_modules/secure-json-parse/index.js +39 -4
- package/node_modules/secure-json-parse/package.json +41 -8
- package/node_modules/secure-json-parse/test/index.test.js +150 -6
- package/node_modules/secure-json-parse/types/index.d.ts +9 -6
- package/node_modules/secure-json-parse/types/index.test-d.ts +13 -1
- package/node_modules/strip-json-comments/index.d.ts +18 -13
- package/node_modules/strip-json-comments/index.js +75 -39
- package/node_modules/strip-json-comments/package.json +14 -5
- package/node_modules/strip-json-comments/readme.md +15 -18
- package/node_modules/thread-stream/.github/workflows/ci.yml +4 -24
- package/node_modules/thread-stream/README.md +2 -0
- package/node_modules/thread-stream/eslint.config.js +10 -0
- package/node_modules/thread-stream/index.d.ts +7 -0
- package/node_modules/thread-stream/index.js +189 -109
- package/node_modules/thread-stream/lib/wait.js +58 -42
- package/node_modules/thread-stream/lib/worker.js +126 -14
- package/node_modules/thread-stream/node_modules/real-require/LICENSE.md +21 -0
- package/node_modules/thread-stream/node_modules/real-require/README.md +51 -0
- package/node_modules/thread-stream/node_modules/real-require/package.json +38 -0
- package/node_modules/thread-stream/node_modules/real-require/src/index.js +14 -0
- package/node_modules/thread-stream/package.json +18 -25
- package/node_modules/thread-stream/test/base.test.js +97 -96
- package/node_modules/thread-stream/test/bench.test.js +3 -3
- package/node_modules/thread-stream/test/bundlers.test.js +8 -9
- package/node_modules/thread-stream/test/commonjs-fallback.test.js +17 -22
- package/node_modules/thread-stream/test/context.test.js +6 -6
- package/node_modules/thread-stream/test/end.test.js +22 -27
- package/node_modules/thread-stream/test/esm.test.mjs +8 -9
- package/node_modules/thread-stream/test/event.test.js +10 -9
- package/node_modules/thread-stream/test/flush-worker.js +68 -0
- package/node_modules/thread-stream/test/flush.test.js +112 -0
- package/node_modules/thread-stream/test/helper.js +1 -10
- package/node_modules/thread-stream/test/indexes.test.js +4 -4
- package/node_modules/thread-stream/test/multibyte-chars.test.mjs +14 -13
- package/node_modules/thread-stream/test/multibyte-overrun.test.mjs +33 -0
- package/node_modules/thread-stream/test/pkg/index.js +23 -23
- package/node_modules/thread-stream/test/pkg/pkg.config.json +3 -4
- package/node_modules/thread-stream/test/pkg/pkg.test.js +5 -6
- package/node_modules/thread-stream/test/post-message.test.js +4 -5
- package/node_modules/thread-stream/test/report-thread-name.js +16 -0
- package/node_modules/thread-stream/test/string-limit-2.test.js +24 -30
- package/node_modules/thread-stream/test/string-limit.test.js +24 -29
- package/node_modules/thread-stream/test/thread-management.test.js +46 -17
- package/node_modules/thread-stream/test/transpiled.test.js +5 -6
- package/node_modules/thread-stream/test/ts-native.test.mjs +35 -0
- package/node_modules/thread-stream/test/ts-node-fallback.test.js +35 -0
- package/node_modules/thread-stream/test/watch-mode.test.js +13 -11
- package/node_modules/thread-stream/test/worker-name.test.js +43 -0
- package/package.json +8 -8
- package/node_modules/@zuplo/editor/node_modules/process-warning/.github/dependabot.yml +0 -53
- package/node_modules/@zuplo/editor/node_modules/process-warning/.github/workflows/ci.yml +0 -33
- package/node_modules/@zuplo/editor/node_modules/process-warning/README.md +0 -157
- package/node_modules/@zuplo/editor/node_modules/process-warning/benchmarks/warn.js +0 -25
- package/node_modules/@zuplo/editor/node_modules/process-warning/examples/example.js +0 -11
- package/node_modules/@zuplo/editor/node_modules/process-warning/index.js +0 -192
- package/node_modules/@zuplo/editor/node_modules/process-warning/package.json +0 -72
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-interpolated-string.test.js +0 -34
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-once-only.test.js +0 -33
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-reset.test.js +0 -40
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-set.test.js +0 -35
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/emit-unlimited.test.js +0 -42
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/index.test.js +0 -99
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/issue-88.test.js +0 -38
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/jest.test.js +0 -24
- package/node_modules/@zuplo/editor/node_modules/process-warning/test/no-warnings.test.js +0 -80
- package/node_modules/@zuplo/editor/node_modules/process-warning/types/index.d.ts +0 -51
- package/node_modules/@zuplo/runtime/out/esm/chunk-XLNOQPTE.js.map +0 -1
- 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/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/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/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/lock-threads.yml +0 -30
- 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/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/pkg/index.js +0 -46
- package/node_modules/pino/test/pkg/pkg.config.json +0 -17
- package/node_modules/pino/test/pkg/pkg.test.js +0 -56
- package/node_modules/pino/test/transport/core.test.ts +0 -236
- 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/process-warning/types/index.test-d.ts +0 -36
- 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
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/.release-it.beta.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/.release-it.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/CHANGELOG.md +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/cjs/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/index.mjs +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/index.mjs.map +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/esm/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/index.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/index.js.map +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/min/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/copier.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/index.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/dist/umd/types/utils.d.ts +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/flow-typed/fast-copy.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.base.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.cjs.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.esm.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.min.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/config.umd.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/rollup/packageJson.js +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/base.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/cjs.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/declarations.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/esm.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/min.json +0 -0
- /package/node_modules/{fast-copy → @zuplo/editor/node_modules/fast-copy}/tsconfig/umd.json +0 -0
- /package/node_modules/{pino → @zuplo/editor/node_modules/pino-abstract-transport}/.github/dependabot.yml +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/pino-abstract-transport}/.husky/pre-commit +0 -0
- /package/node_modules/{secure-json-parse → @zuplo/editor/node_modules/secure-json-parse}/LICENSE.md +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/.taprc +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/CLAUDE.md +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/test/never-drain.test.js +0 -0
- /package/node_modules/{thread-stream → @zuplo/editor/node_modules/thread-stream}/test/ts.test.ts +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-XLNOQPTE.js.LEGAL.txt → chunk-RS7HF7BL.js.LEGAL.txt} +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/.github/workflows/lock-threads.yml +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/test/promise.js +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/test/spy-warning.test.js +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → process-warning}/types/index.tst.ts +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → secure-json-parse}/.gitattributes +0 -0
- /package/node_modules/{@zuplo/editor/node_modules/process-warning → secure-json-parse}/eslint.config.js +0 -0
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
process.env.TZ = 'UTC'
|
|
4
4
|
|
|
5
|
-
const { Writable } = require('
|
|
6
|
-
const os = require('os')
|
|
7
|
-
const test = require('
|
|
5
|
+
const { Writable } = require('node:stream')
|
|
6
|
+
const os = require('node:os')
|
|
7
|
+
const { describe, test, beforeEach, afterEach } = require('node:test')
|
|
8
|
+
const match = require('@jsumners/assert-match')
|
|
8
9
|
const pino = require('pino')
|
|
9
10
|
const dateformat = require('dateformat')
|
|
10
|
-
const path = require('path')
|
|
11
11
|
const rimraf = require('rimraf')
|
|
12
|
-
const { join } = require('path')
|
|
13
|
-
const fs = require('fs')
|
|
12
|
+
const { join } = require('node:path')
|
|
13
|
+
const fs = require('node:fs')
|
|
14
14
|
const semver = require('semver')
|
|
15
15
|
const pinoPretty = require('..')
|
|
16
16
|
const SonicBoom = require('sonic-boom')
|
|
@@ -37,30 +37,30 @@ const formattedEpoch = '17:35:28.992'
|
|
|
37
37
|
const pid = process.pid
|
|
38
38
|
const hostname = os.hostname()
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
describe('basic prettifier tests', () => {
|
|
41
|
+
beforeEach(() => {
|
|
42
42
|
Date.originalNow = Date.now
|
|
43
43
|
Date.now = () => epoch
|
|
44
44
|
})
|
|
45
|
-
|
|
45
|
+
afterEach(() => {
|
|
46
46
|
Date.now = Date.originalNow
|
|
47
47
|
delete Date.originalNow
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
test('preserves output if not valid JSON', (t) => {
|
|
51
51
|
t.plan(1)
|
|
52
52
|
const pretty = prettyFactory()
|
|
53
53
|
const formatted = pretty('this is not json\nit\'s just regular output\n')
|
|
54
|
-
t.
|
|
54
|
+
t.assert.strictEqual(formatted, 'this is not json\nit\'s just regular output\n\n')
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
test('formats a line without any extra options', (t) => {
|
|
58
58
|
t.plan(1)
|
|
59
59
|
const pretty = prettyFactory()
|
|
60
60
|
const log = pino({}, new Writable({
|
|
61
61
|
write (chunk, enc, cb) {
|
|
62
62
|
const formatted = pretty(chunk.toString())
|
|
63
|
-
t.
|
|
63
|
+
t.assert.strictEqual(
|
|
64
64
|
formatted,
|
|
65
65
|
`[${formattedEpoch}] INFO (${pid}): foo\n`
|
|
66
66
|
)
|
|
@@ -70,13 +70,13 @@ test('basic prettifier tests', (t) => {
|
|
|
70
70
|
log.info('foo')
|
|
71
71
|
})
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
test('will add color codes', (t) => {
|
|
74
74
|
t.plan(1)
|
|
75
75
|
const pretty = prettyFactory({ colorize: true })
|
|
76
76
|
const log = pino({}, new Writable({
|
|
77
77
|
write (chunk, enc, cb) {
|
|
78
78
|
const formatted = pretty(chunk.toString())
|
|
79
|
-
t.
|
|
79
|
+
t.assert.strictEqual(
|
|
80
80
|
formatted,
|
|
81
81
|
`[${formattedEpoch}] \u001B[32mINFO\u001B[39m (${pid}): \u001B[36mfoo\u001B[39m\n`
|
|
82
82
|
)
|
|
@@ -86,13 +86,13 @@ test('basic prettifier tests', (t) => {
|
|
|
86
86
|
log.info('foo')
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
test('will omit color codes from objects when colorizeObjects = false', (t) => {
|
|
90
90
|
t.plan(1)
|
|
91
91
|
const pretty = prettyFactory({ colorize: true, singleLine: true, colorizeObjects: false })
|
|
92
92
|
const log = pino({}, new Writable({
|
|
93
93
|
write (chunk, enc, cb) {
|
|
94
94
|
const formatted = pretty(chunk.toString())
|
|
95
|
-
t.
|
|
95
|
+
t.assert.strictEqual(
|
|
96
96
|
formatted,
|
|
97
97
|
`[${formattedEpoch}] \u001B[32mINFO\u001B[39m (${pid}): \u001B[36mfoo\u001B[39m {"foo":"bar"}\n`
|
|
98
98
|
)
|
|
@@ -102,11 +102,11 @@ test('basic prettifier tests', (t) => {
|
|
|
102
102
|
log.info({ foo: 'bar' }, 'foo')
|
|
103
103
|
})
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
test('can swap date and level position', (t) => {
|
|
106
106
|
t.plan(1)
|
|
107
107
|
const destination = new Writable({
|
|
108
108
|
write (formatted, enc, cb) {
|
|
109
|
-
t.
|
|
109
|
+
t.assert.strictEqual(
|
|
110
110
|
formatted.toString(),
|
|
111
111
|
`INFO [${formattedEpoch}] (${pid}): foo\n`
|
|
112
112
|
)
|
|
@@ -122,13 +122,13 @@ test('basic prettifier tests', (t) => {
|
|
|
122
122
|
log.info('foo')
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
test('can print message key value when its a string', (t) => {
|
|
126
126
|
t.plan(1)
|
|
127
127
|
const pretty = prettyFactory()
|
|
128
128
|
const log = pino({}, new Writable({
|
|
129
129
|
write (chunk, enc, cb) {
|
|
130
130
|
const formatted = pretty(chunk.toString())
|
|
131
|
-
t.
|
|
131
|
+
t.assert.strictEqual(
|
|
132
132
|
formatted,
|
|
133
133
|
`[${formattedEpoch}] INFO (${pid}): baz\n`
|
|
134
134
|
)
|
|
@@ -138,13 +138,13 @@ test('basic prettifier tests', (t) => {
|
|
|
138
138
|
log.info('baz')
|
|
139
139
|
})
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
test('can print message key value when its a number', (t) => {
|
|
142
142
|
t.plan(1)
|
|
143
143
|
const pretty = prettyFactory()
|
|
144
144
|
const log = pino({}, new Writable({
|
|
145
145
|
write (chunk, enc, cb) {
|
|
146
146
|
const formatted = pretty(chunk.toString())
|
|
147
|
-
t.
|
|
147
|
+
t.assert.strictEqual(
|
|
148
148
|
formatted,
|
|
149
149
|
`[${formattedEpoch}] INFO (${pid}): 42\n`
|
|
150
150
|
)
|
|
@@ -154,13 +154,13 @@ test('basic prettifier tests', (t) => {
|
|
|
154
154
|
log.info(42)
|
|
155
155
|
})
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
test('can print message key value when its a Number(0)', (t) => {
|
|
158
158
|
t.plan(1)
|
|
159
159
|
const pretty = prettyFactory()
|
|
160
160
|
const log = pino({}, new Writable({
|
|
161
161
|
write (chunk, enc, cb) {
|
|
162
162
|
const formatted = pretty(chunk.toString())
|
|
163
|
-
t.
|
|
163
|
+
t.assert.strictEqual(
|
|
164
164
|
formatted,
|
|
165
165
|
`[${formattedEpoch}] INFO (${pid}): 0\n`
|
|
166
166
|
)
|
|
@@ -170,13 +170,13 @@ test('basic prettifier tests', (t) => {
|
|
|
170
170
|
log.info(0)
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
test('can print message key value when its a boolean', (t) => {
|
|
174
174
|
t.plan(1)
|
|
175
175
|
const pretty = prettyFactory()
|
|
176
176
|
const log = pino({}, new Writable({
|
|
177
177
|
write (chunk, enc, cb) {
|
|
178
178
|
const formatted = pretty(chunk.toString())
|
|
179
|
-
t.
|
|
179
|
+
t.assert.strictEqual(
|
|
180
180
|
formatted,
|
|
181
181
|
`[${formattedEpoch}] INFO (${pid}): true\n`
|
|
182
182
|
)
|
|
@@ -186,13 +186,13 @@ test('basic prettifier tests', (t) => {
|
|
|
186
186
|
log.info(true)
|
|
187
187
|
})
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
test('can use different message keys', (t) => {
|
|
190
190
|
t.plan(1)
|
|
191
191
|
const pretty = prettyFactory({ messageKey: 'bar' })
|
|
192
192
|
const log = pino({}, new Writable({
|
|
193
193
|
write (chunk, enc, cb) {
|
|
194
194
|
const formatted = pretty(chunk.toString())
|
|
195
|
-
t.
|
|
195
|
+
t.assert.strictEqual(
|
|
196
196
|
formatted,
|
|
197
197
|
`[${formattedEpoch}] INFO (${pid}): baz\n`
|
|
198
198
|
)
|
|
@@ -202,13 +202,13 @@ test('basic prettifier tests', (t) => {
|
|
|
202
202
|
log.info({ bar: 'baz' })
|
|
203
203
|
})
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
test('can use different level keys', (t) => {
|
|
206
206
|
t.plan(1)
|
|
207
207
|
const pretty = prettyFactory({ levelKey: 'bar' })
|
|
208
208
|
const log = pino({}, new Writable({
|
|
209
209
|
write (chunk, enc, cb) {
|
|
210
210
|
const formatted = pretty(chunk.toString())
|
|
211
|
-
t.
|
|
211
|
+
t.assert.strictEqual(
|
|
212
212
|
formatted,
|
|
213
213
|
`[${formattedEpoch}] WARN (${pid}): foo\n`
|
|
214
214
|
)
|
|
@@ -218,7 +218,23 @@ test('basic prettifier tests', (t) => {
|
|
|
218
218
|
log.info({ msg: 'foo', bar: 'warn' })
|
|
219
219
|
})
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
test('can use nested level keys', (t) => {
|
|
222
|
+
t.plan(1)
|
|
223
|
+
const pretty = prettyFactory({ levelKey: 'log\\.level' })
|
|
224
|
+
const log = pino({}, new Writable({
|
|
225
|
+
write (chunk, enc, cb) {
|
|
226
|
+
const formatted = pretty(chunk.toString())
|
|
227
|
+
t.assert.strictEqual(
|
|
228
|
+
formatted,
|
|
229
|
+
`[${formattedEpoch}] WARN (${pid}): foo\n`
|
|
230
|
+
)
|
|
231
|
+
cb()
|
|
232
|
+
}
|
|
233
|
+
}))
|
|
234
|
+
log.info({ msg: 'foo', 'log.level': 'warn' })
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
test('can use a customPrettifier on default level output', (t) => {
|
|
222
238
|
t.plan(1)
|
|
223
239
|
const veryCustomLevels = {
|
|
224
240
|
30: 'ok',
|
|
@@ -231,7 +247,7 @@ test('basic prettifier tests', (t) => {
|
|
|
231
247
|
const log = pino({}, new Writable({
|
|
232
248
|
write (chunk, enc, cb) {
|
|
233
249
|
const formatted = pretty(chunk.toString())
|
|
234
|
-
t.
|
|
250
|
+
t.assert.strictEqual(
|
|
235
251
|
formatted,
|
|
236
252
|
`[${formattedEpoch}] LEVEL: ok (${pid}): foo\n`
|
|
237
253
|
)
|
|
@@ -241,7 +257,7 @@ test('basic prettifier tests', (t) => {
|
|
|
241
257
|
log.info({ msg: 'foo' })
|
|
242
258
|
})
|
|
243
259
|
|
|
244
|
-
|
|
260
|
+
test('can use a customPrettifier on different-level-key output', (t) => {
|
|
245
261
|
t.plan(1)
|
|
246
262
|
const customPrettifiers = {
|
|
247
263
|
level: (level) => `LEVEL: ${level.toUpperCase()}`
|
|
@@ -250,7 +266,7 @@ test('basic prettifier tests', (t) => {
|
|
|
250
266
|
const log = pino({}, new Writable({
|
|
251
267
|
write (chunk, enc, cb) {
|
|
252
268
|
const formatted = pretty(chunk.toString())
|
|
253
|
-
t.
|
|
269
|
+
t.assert.strictEqual(
|
|
254
270
|
formatted,
|
|
255
271
|
`[${formattedEpoch}] LEVEL: WARN (${pid}): foo\n`
|
|
256
272
|
)
|
|
@@ -260,7 +276,7 @@ test('basic prettifier tests', (t) => {
|
|
|
260
276
|
log.info({ msg: 'foo', bar: 'warn' })
|
|
261
277
|
})
|
|
262
278
|
|
|
263
|
-
|
|
279
|
+
test('can use a customPrettifier to get final level label (no color)', (t) => {
|
|
264
280
|
t.plan(1)
|
|
265
281
|
const customPrettifiers = {
|
|
266
282
|
level: (level, key, logThis, { label }) => {
|
|
@@ -271,7 +287,7 @@ test('basic prettifier tests', (t) => {
|
|
|
271
287
|
const log = pino({}, new Writable({
|
|
272
288
|
write (chunk, enc, cb) {
|
|
273
289
|
const formatted = pretty(chunk.toString())
|
|
274
|
-
t.
|
|
290
|
+
t.assert.strictEqual(
|
|
275
291
|
formatted,
|
|
276
292
|
`[${formattedEpoch}] LEVEL: INFO (${pid}): foo\n`
|
|
277
293
|
)
|
|
@@ -281,7 +297,7 @@ test('basic prettifier tests', (t) => {
|
|
|
281
297
|
log.info({ msg: 'foo' })
|
|
282
298
|
})
|
|
283
299
|
|
|
284
|
-
|
|
300
|
+
test('can use a customPrettifier to get final level label (colorized)', (t) => {
|
|
285
301
|
t.plan(1)
|
|
286
302
|
const customPrettifiers = {
|
|
287
303
|
level: (level, key, logThis, { label, labelColorized }) => {
|
|
@@ -292,7 +308,7 @@ test('basic prettifier tests', (t) => {
|
|
|
292
308
|
const log = pino({}, new Writable({
|
|
293
309
|
write (chunk, enc, cb) {
|
|
294
310
|
const formatted = pretty(chunk.toString())
|
|
295
|
-
t.
|
|
311
|
+
t.assert.strictEqual(
|
|
296
312
|
formatted,
|
|
297
313
|
`[${formattedEpoch}] LEVEL: [32mINFO[39m (${pid}): [36mfoo[39m\n`
|
|
298
314
|
)
|
|
@@ -302,7 +318,7 @@ test('basic prettifier tests', (t) => {
|
|
|
302
318
|
log.info({ msg: 'foo' })
|
|
303
319
|
})
|
|
304
320
|
|
|
305
|
-
|
|
321
|
+
test('can use a customPrettifier on name output', (t) => {
|
|
306
322
|
t.plan(1)
|
|
307
323
|
const customPrettifiers = {
|
|
308
324
|
name: (hostname) => `NAME: ${hostname}`
|
|
@@ -311,7 +327,7 @@ test('basic prettifier tests', (t) => {
|
|
|
311
327
|
const log = pino({}, new Writable({
|
|
312
328
|
write (chunk, enc, cb) {
|
|
313
329
|
const formatted = pretty(chunk.toString())
|
|
314
|
-
t.
|
|
330
|
+
t.assert.strictEqual(
|
|
315
331
|
formatted,
|
|
316
332
|
`[${formattedEpoch}] INFO (NAME: logger/${pid}): foo\n`
|
|
317
333
|
)
|
|
@@ -322,7 +338,7 @@ test('basic prettifier tests', (t) => {
|
|
|
322
338
|
child.info({ msg: 'foo' })
|
|
323
339
|
})
|
|
324
340
|
|
|
325
|
-
|
|
341
|
+
test('can use a customPrettifier on hostname and pid output', (t) => {
|
|
326
342
|
t.plan(1)
|
|
327
343
|
const customPrettifiers = {
|
|
328
344
|
hostname: (hostname) => `HOSTNAME: ${hostname}`,
|
|
@@ -332,7 +348,7 @@ test('basic prettifier tests', (t) => {
|
|
|
332
348
|
const log = pino({}, new Writable({
|
|
333
349
|
write (chunk, enc, cb) {
|
|
334
350
|
const formatted = pretty(chunk.toString())
|
|
335
|
-
t.
|
|
351
|
+
t.assert.strictEqual(
|
|
336
352
|
formatted,
|
|
337
353
|
`[${formattedEpoch}] INFO (PID: ${pid} on HOSTNAME: ${hostname}): foo\n`
|
|
338
354
|
)
|
|
@@ -342,7 +358,7 @@ test('basic prettifier tests', (t) => {
|
|
|
342
358
|
log.info({ msg: 'foo' })
|
|
343
359
|
})
|
|
344
360
|
|
|
345
|
-
|
|
361
|
+
test('can use a customPrettifier on default time output', (t) => {
|
|
346
362
|
t.plan(1)
|
|
347
363
|
const customPrettifiers = {
|
|
348
364
|
time: (timestamp) => `TIME: ${timestamp}`
|
|
@@ -351,7 +367,7 @@ test('basic prettifier tests', (t) => {
|
|
|
351
367
|
const log = pino({}, new Writable({
|
|
352
368
|
write (chunk, enc, cb) {
|
|
353
369
|
const formatted = pretty(chunk.toString())
|
|
354
|
-
t.
|
|
370
|
+
t.assert.strictEqual(
|
|
355
371
|
formatted,
|
|
356
372
|
`TIME: ${formattedEpoch} INFO (${pid}): foo\n`
|
|
357
373
|
)
|
|
@@ -361,7 +377,7 @@ test('basic prettifier tests', (t) => {
|
|
|
361
377
|
log.info('foo')
|
|
362
378
|
})
|
|
363
379
|
|
|
364
|
-
|
|
380
|
+
test('can use a customPrettifier on the caller', (t) => {
|
|
365
381
|
t.plan(1)
|
|
366
382
|
const customPrettifiers = {
|
|
367
383
|
caller: (caller) => `CALLER: ${caller}`
|
|
@@ -370,7 +386,7 @@ test('basic prettifier tests', (t) => {
|
|
|
370
386
|
const log = pino({}, new Writable({
|
|
371
387
|
write (chunk, enc, cb) {
|
|
372
388
|
const formatted = pretty(chunk.toString())
|
|
373
|
-
t.
|
|
389
|
+
t.assert.strictEqual(
|
|
374
390
|
formatted,
|
|
375
391
|
`[${formattedEpoch}] INFO (${pid}) <CALLER: test.js:10>: foo\n`
|
|
376
392
|
)
|
|
@@ -380,7 +396,7 @@ test('basic prettifier tests', (t) => {
|
|
|
380
396
|
log.info({ msg: 'foo', caller: 'test.js:10' })
|
|
381
397
|
})
|
|
382
398
|
|
|
383
|
-
|
|
399
|
+
test('can use a customPrettifier on translateTime-time output', (t) => {
|
|
384
400
|
t.plan(1)
|
|
385
401
|
const customPrettifiers = {
|
|
386
402
|
time: (timestamp) => `TIME: ${timestamp}`
|
|
@@ -389,7 +405,7 @@ test('basic prettifier tests', (t) => {
|
|
|
389
405
|
const log = pino({}, new Writable({
|
|
390
406
|
write (chunk, enc, cb) {
|
|
391
407
|
const formatted = pretty(chunk.toString())
|
|
392
|
-
t.
|
|
408
|
+
t.assert.strictEqual(
|
|
393
409
|
formatted,
|
|
394
410
|
`TIME: ${formattedEpoch} INFO (${pid}): foo\n`
|
|
395
411
|
)
|
|
@@ -399,13 +415,13 @@ test('basic prettifier tests', (t) => {
|
|
|
399
415
|
log.info('foo')
|
|
400
416
|
})
|
|
401
417
|
|
|
402
|
-
|
|
418
|
+
test('will format time to UTC', (t) => {
|
|
403
419
|
t.plan(1)
|
|
404
420
|
const pretty = prettyFactory({ translateTime: true })
|
|
405
421
|
const log = pino({}, new Writable({
|
|
406
422
|
write (chunk, enc, cb) {
|
|
407
423
|
const formatted = pretty(chunk.toString())
|
|
408
|
-
t.
|
|
424
|
+
t.assert.strictEqual(
|
|
409
425
|
formatted,
|
|
410
426
|
`[${formattedEpoch}] INFO (${pid}): foo\n`
|
|
411
427
|
)
|
|
@@ -415,7 +431,7 @@ test('basic prettifier tests', (t) => {
|
|
|
415
431
|
log.info('foo')
|
|
416
432
|
})
|
|
417
433
|
|
|
418
|
-
|
|
434
|
+
test('will format time to UTC in custom format', (t) => {
|
|
419
435
|
t.plan(1)
|
|
420
436
|
const pretty = prettyFactory({ translateTime: 'HH:MM:ss o' })
|
|
421
437
|
const log = pino({}, new Writable({
|
|
@@ -423,7 +439,7 @@ test('basic prettifier tests', (t) => {
|
|
|
423
439
|
const formatted = pretty(chunk.toString())
|
|
424
440
|
const utcHour = dateformat(epoch, 'UTC:' + 'HH')
|
|
425
441
|
const offset = dateformat(epoch, 'UTC:' + 'o')
|
|
426
|
-
t.
|
|
442
|
+
t.assert.strictEqual(
|
|
427
443
|
formatted,
|
|
428
444
|
`[${utcHour}:35:28 ${offset}] INFO (${pid}): foo\n`
|
|
429
445
|
)
|
|
@@ -433,7 +449,7 @@ test('basic prettifier tests', (t) => {
|
|
|
433
449
|
log.info('foo')
|
|
434
450
|
})
|
|
435
451
|
|
|
436
|
-
|
|
452
|
+
test('will format time to local systemzone in ISO 8601 format', (t) => {
|
|
437
453
|
t.plan(1)
|
|
438
454
|
const pretty = prettyFactory({ translateTime: 'sys:standard' })
|
|
439
455
|
const log = pino({}, new Writable({
|
|
@@ -443,7 +459,7 @@ test('basic prettifier tests', (t) => {
|
|
|
443
459
|
const localMinute = dateformat(epoch, 'MM')
|
|
444
460
|
const localDate = dateformat(epoch, 'yyyy-mm-dd')
|
|
445
461
|
const offset = dateformat(epoch, 'o')
|
|
446
|
-
t.
|
|
462
|
+
t.assert.strictEqual(
|
|
447
463
|
formatted,
|
|
448
464
|
`[${localDate} ${localHour}:${localMinute}:28.992 ${offset}] INFO (${pid}): foo\n`
|
|
449
465
|
)
|
|
@@ -453,7 +469,7 @@ test('basic prettifier tests', (t) => {
|
|
|
453
469
|
log.info('foo')
|
|
454
470
|
})
|
|
455
471
|
|
|
456
|
-
|
|
472
|
+
test('will format time to local systemzone in custom format', (t) => {
|
|
457
473
|
t.plan(1)
|
|
458
474
|
const pretty = prettyFactory({
|
|
459
475
|
translateTime: 'SYS:yyyy/mm/dd HH:MM:ss o'
|
|
@@ -465,7 +481,7 @@ test('basic prettifier tests', (t) => {
|
|
|
465
481
|
const localMinute = dateformat(epoch, 'MM')
|
|
466
482
|
const localDate = dateformat(epoch, 'yyyy/mm/dd')
|
|
467
483
|
const offset = dateformat(epoch, 'o')
|
|
468
|
-
t.
|
|
484
|
+
t.assert.strictEqual(
|
|
469
485
|
formatted,
|
|
470
486
|
`[${localDate} ${localHour}:${localMinute}:28 ${offset}] INFO (${pid}): foo\n`
|
|
471
487
|
)
|
|
@@ -476,27 +492,27 @@ test('basic prettifier tests', (t) => {
|
|
|
476
492
|
})
|
|
477
493
|
|
|
478
494
|
// TODO: 2019-03-30 -- We don't really want the indentation in this case? Or at least some better formatting.
|
|
479
|
-
|
|
495
|
+
test('handles missing time', (t) => {
|
|
480
496
|
t.plan(1)
|
|
481
497
|
const pretty = prettyFactory()
|
|
482
498
|
const formatted = pretty('{"hello":"world"}')
|
|
483
|
-
t.
|
|
499
|
+
t.assert.strictEqual(formatted, ' hello: "world"\n')
|
|
484
500
|
})
|
|
485
501
|
|
|
486
|
-
|
|
502
|
+
test('handles missing pid, hostname and name', (t) => {
|
|
487
503
|
t.plan(1)
|
|
488
504
|
const pretty = prettyFactory()
|
|
489
505
|
const log = pino({ base: null }, new Writable({
|
|
490
506
|
write (chunk, enc, cb) {
|
|
491
507
|
const formatted = pretty(chunk.toString())
|
|
492
|
-
t.match(formatted, /\[.*\] INFO: hello world/)
|
|
508
|
+
t.assert.match(formatted, /\[.*\] INFO: hello world/)
|
|
493
509
|
cb()
|
|
494
510
|
}
|
|
495
511
|
}))
|
|
496
512
|
log.info('hello world')
|
|
497
513
|
})
|
|
498
514
|
|
|
499
|
-
|
|
515
|
+
test('handles missing pid', (t) => {
|
|
500
516
|
t.plan(1)
|
|
501
517
|
const pretty = prettyFactory()
|
|
502
518
|
const name = 'test'
|
|
@@ -512,7 +528,7 @@ test('basic prettifier tests', (t) => {
|
|
|
512
528
|
const log = pino(opts, new Writable({
|
|
513
529
|
write (chunk, enc, cb) {
|
|
514
530
|
const formatted = pretty(chunk.toString())
|
|
515
|
-
t.match(formatted, regex)
|
|
531
|
+
t.assert.match(formatted, regex)
|
|
516
532
|
cb()
|
|
517
533
|
}
|
|
518
534
|
}))
|
|
@@ -520,7 +536,7 @@ test('basic prettifier tests', (t) => {
|
|
|
520
536
|
log.info(msg)
|
|
521
537
|
})
|
|
522
538
|
|
|
523
|
-
|
|
539
|
+
test('handles missing hostname', (t) => {
|
|
524
540
|
t.plan(1)
|
|
525
541
|
const pretty = prettyFactory()
|
|
526
542
|
const name = 'test'
|
|
@@ -536,7 +552,7 @@ test('basic prettifier tests', (t) => {
|
|
|
536
552
|
const log = pino(opts, new Writable({
|
|
537
553
|
write (chunk, enc, cb) {
|
|
538
554
|
const formatted = pretty(chunk.toString())
|
|
539
|
-
t.match(formatted, regex)
|
|
555
|
+
t.assert.match(formatted, regex)
|
|
540
556
|
cb()
|
|
541
557
|
}
|
|
542
558
|
}))
|
|
@@ -544,7 +560,7 @@ test('basic prettifier tests', (t) => {
|
|
|
544
560
|
log.info(msg)
|
|
545
561
|
})
|
|
546
562
|
|
|
547
|
-
|
|
563
|
+
test('handles missing name', (t) => {
|
|
548
564
|
t.plan(1)
|
|
549
565
|
const pretty = prettyFactory()
|
|
550
566
|
const msg = 'hello world'
|
|
@@ -559,7 +575,7 @@ test('basic prettifier tests', (t) => {
|
|
|
559
575
|
const log = pino(opts, new Writable({
|
|
560
576
|
write (chunk, enc, cb) {
|
|
561
577
|
const formatted = pretty(chunk.toString())
|
|
562
|
-
t.match(formatted, regex)
|
|
578
|
+
t.assert.match(formatted, regex)
|
|
563
579
|
cb()
|
|
564
580
|
}
|
|
565
581
|
}))
|
|
@@ -567,33 +583,33 @@ test('basic prettifier tests', (t) => {
|
|
|
567
583
|
log.info(msg)
|
|
568
584
|
})
|
|
569
585
|
|
|
570
|
-
|
|
586
|
+
test('works without time', (t) => {
|
|
571
587
|
t.plan(1)
|
|
572
588
|
const pretty = prettyFactory()
|
|
573
589
|
const log = pino({ timestamp: null }, new Writable({
|
|
574
590
|
write (chunk, enc, cb) {
|
|
575
591
|
const formatted = pretty(chunk.toString())
|
|
576
|
-
t.
|
|
592
|
+
t.assert.strictEqual(formatted, `INFO (${pid}): hello world\n`)
|
|
577
593
|
cb()
|
|
578
594
|
}
|
|
579
595
|
}))
|
|
580
596
|
log.info('hello world')
|
|
581
597
|
})
|
|
582
598
|
|
|
583
|
-
|
|
599
|
+
test('prettifies properties', (t) => {
|
|
584
600
|
t.plan(1)
|
|
585
601
|
const pretty = prettyFactory()
|
|
586
602
|
const log = pino({}, new Writable({
|
|
587
603
|
write (chunk, enc, cb) {
|
|
588
604
|
const formatted = pretty(chunk.toString())
|
|
589
|
-
|
|
605
|
+
match(formatted, ' a: "b"', t)
|
|
590
606
|
cb()
|
|
591
607
|
}
|
|
592
608
|
}))
|
|
593
609
|
log.info({ a: 'b' }, 'hello world')
|
|
594
610
|
})
|
|
595
611
|
|
|
596
|
-
|
|
612
|
+
test('prettifies nested properties', (t) => {
|
|
597
613
|
t.plan(6)
|
|
598
614
|
const expectedLines = [
|
|
599
615
|
' a: {',
|
|
@@ -607,10 +623,10 @@ test('basic prettifier tests', (t) => {
|
|
|
607
623
|
write (chunk, enc, cb) {
|
|
608
624
|
const formatted = pretty(chunk.toString())
|
|
609
625
|
const lines = formatted.split('\n')
|
|
610
|
-
t.
|
|
626
|
+
t.assert.strictEqual(lines.length, expectedLines.length + 2)
|
|
611
627
|
lines.shift(); lines.pop()
|
|
612
628
|
for (let i = 0; i < lines.length; i += 1) {
|
|
613
|
-
t.
|
|
629
|
+
t.assert.strictEqual(lines[i], expectedLines[i])
|
|
614
630
|
}
|
|
615
631
|
cb()
|
|
616
632
|
}
|
|
@@ -618,74 +634,70 @@ test('basic prettifier tests', (t) => {
|
|
|
618
634
|
log.info({ a: { b: { c: 'd' } } }, 'hello world')
|
|
619
635
|
})
|
|
620
636
|
|
|
621
|
-
|
|
637
|
+
test('treats the name with care', (t) => {
|
|
622
638
|
t.plan(1)
|
|
623
639
|
const pretty = prettyFactory()
|
|
624
640
|
const log = pino({ name: 'matteo' }, new Writable({
|
|
625
641
|
write (chunk, enc, cb) {
|
|
626
642
|
const formatted = pretty(chunk.toString())
|
|
627
|
-
t.
|
|
643
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (matteo/${pid}): hello world\n`)
|
|
628
644
|
cb()
|
|
629
645
|
}
|
|
630
646
|
}))
|
|
631
647
|
log.info('hello world')
|
|
632
648
|
})
|
|
633
649
|
|
|
634
|
-
|
|
650
|
+
test('handles spec allowed primitives', (t) => {
|
|
635
651
|
const pretty = prettyFactory()
|
|
636
652
|
let formatted = pretty(null)
|
|
637
|
-
t.
|
|
653
|
+
t.assert.strictEqual(formatted, 'null\n')
|
|
638
654
|
|
|
639
655
|
formatted = pretty(true)
|
|
640
|
-
t.
|
|
656
|
+
t.assert.strictEqual(formatted, 'true\n')
|
|
641
657
|
|
|
642
658
|
formatted = pretty(false)
|
|
643
|
-
t.
|
|
644
|
-
|
|
645
|
-
t.end()
|
|
659
|
+
t.assert.strictEqual(formatted, 'false\n')
|
|
646
660
|
})
|
|
647
661
|
|
|
648
|
-
|
|
662
|
+
test('handles numbers', (t) => {
|
|
649
663
|
const pretty = prettyFactory()
|
|
650
664
|
let formatted = pretty(2)
|
|
651
|
-
t.
|
|
665
|
+
t.assert.strictEqual(formatted, '2\n')
|
|
652
666
|
|
|
653
667
|
formatted = pretty(-2)
|
|
654
|
-
t.
|
|
668
|
+
t.assert.strictEqual(formatted, '-2\n')
|
|
655
669
|
|
|
656
670
|
formatted = pretty(0.2)
|
|
657
|
-
t.
|
|
671
|
+
t.assert.strictEqual(formatted, '0.2\n')
|
|
658
672
|
|
|
659
673
|
formatted = pretty(Infinity)
|
|
660
|
-
t.
|
|
674
|
+
t.assert.strictEqual(formatted, 'Infinity\n')
|
|
661
675
|
|
|
662
676
|
formatted = pretty(NaN)
|
|
663
|
-
t.
|
|
664
|
-
|
|
665
|
-
t.end()
|
|
677
|
+
t.assert.strictEqual(formatted, 'NaN\n')
|
|
666
678
|
})
|
|
667
679
|
|
|
668
|
-
|
|
680
|
+
test('handles `undefined` input', (t) => {
|
|
669
681
|
t.plan(1)
|
|
670
682
|
const pretty = prettyFactory()
|
|
671
683
|
const formatted = pretty(undefined)
|
|
672
|
-
t.
|
|
684
|
+
t.assert.strictEqual(formatted, 'undefined\n')
|
|
673
685
|
})
|
|
674
686
|
|
|
675
|
-
|
|
687
|
+
test('handles customLogLevel', (t) => {
|
|
676
688
|
t.plan(1)
|
|
677
689
|
const pretty = prettyFactory()
|
|
678
690
|
const log = pino({ customLevels: { testCustom: 35 } }, new Writable({
|
|
679
691
|
write (chunk, enc, cb) {
|
|
680
692
|
const formatted = pretty(chunk.toString())
|
|
681
|
-
t.match(formatted, /USERLVL/)
|
|
693
|
+
t.assert.match(formatted, /USERLVL/)
|
|
682
694
|
cb()
|
|
683
695
|
}
|
|
684
696
|
}))
|
|
685
697
|
log.testCustom('test message')
|
|
686
698
|
})
|
|
687
699
|
|
|
688
|
-
|
|
700
|
+
test('filter some lines based on minimumLevel', (t) => {
|
|
689
701
|
t.plan(3)
|
|
690
702
|
const pretty = prettyFactory({ minimumLevel: 'info' })
|
|
691
703
|
const expected = [
|
|
@@ -696,7 +708,7 @@ test('basic prettifier tests', (t) => {
|
|
|
696
708
|
const log = pino({}, new Writable({
|
|
697
709
|
write (chunk, enc, cb) {
|
|
698
710
|
const formatted = pretty(chunk.toString())
|
|
699
|
-
t.
|
|
711
|
+
t.assert.strictEqual(
|
|
700
712
|
formatted,
|
|
701
713
|
expected.shift()
|
|
702
714
|
)
|
|
@@ -709,7 +721,7 @@ test('basic prettifier tests', (t) => {
|
|
|
709
721
|
log.info({ msg: 'baz', level: 30 })
|
|
710
722
|
})
|
|
711
723
|
|
|
712
|
-
|
|
724
|
+
test('filter lines based on minimumLevel using custom levels and level key', (t) => {
|
|
713
725
|
t.plan(3)
|
|
714
726
|
const pretty = prettyFactory({ minimumLevel: 20, levelKey: 'bar' })
|
|
715
727
|
const expected = [
|
|
@@ -720,7 +732,7 @@ test('basic prettifier tests', (t) => {
|
|
|
720
732
|
const log = pino({}, new Writable({
|
|
721
733
|
write (chunk, enc, cb) {
|
|
722
734
|
const formatted = pretty(chunk.toString())
|
|
723
|
-
t.
|
|
735
|
+
t.assert.strictEqual(
|
|
724
736
|
formatted,
|
|
725
737
|
expected.shift()
|
|
726
738
|
)
|
|
@@ -732,7 +744,7 @@ test('basic prettifier tests', (t) => {
|
|
|
732
744
|
log.info({ msg: 'baz', bar: 30 })
|
|
733
745
|
})
|
|
734
746
|
|
|
735
|
-
|
|
747
|
+
test('formats a line with an undefined field', (t) => {
|
|
736
748
|
t.plan(1)
|
|
737
749
|
const pretty = prettyFactory()
|
|
738
750
|
const log = pino({}, new Writable({
|
|
@@ -741,7 +753,7 @@ test('basic prettifier tests', (t) => {
|
|
|
741
753
|
// weird hack, but we should not crash
|
|
742
754
|
obj.a = undefined
|
|
743
755
|
const formatted = pretty(obj)
|
|
744
|
-
t.
|
|
756
|
+
t.assert.strictEqual(
|
|
745
757
|
formatted,
|
|
746
758
|
`[${formattedEpoch}] INFO (${pid}): foo\n`
|
|
747
759
|
)
|
|
@@ -751,7 +763,7 @@ test('basic prettifier tests', (t) => {
|
|
|
751
763
|
log.info('foo')
|
|
752
764
|
})
|
|
753
765
|
|
|
754
|
-
|
|
766
|
+
test('prettifies msg object', (t) => {
|
|
755
767
|
t.plan(6)
|
|
756
768
|
const expectedLines = [
|
|
757
769
|
' msg: {',
|
|
@@ -765,10 +777,10 @@ test('basic prettifier tests', (t) => {
|
|
|
765
777
|
write (chunk, enc, cb) {
|
|
766
778
|
const formatted = pretty(chunk.toString())
|
|
767
779
|
const lines = formatted.split('\n')
|
|
768
|
-
t.
|
|
780
|
+
t.assert.strictEqual(lines.length, expectedLines.length + 2)
|
|
769
781
|
lines.shift(); lines.pop()
|
|
770
782
|
for (let i = 0; i < lines.length; i += 1) {
|
|
771
|
-
t.
|
|
783
|
+
t.assert.strictEqual(lines[i], expectedLines[i])
|
|
772
784
|
}
|
|
773
785
|
cb()
|
|
774
786
|
}
|
|
@@ -776,7 +788,7 @@ test('basic prettifier tests', (t) => {
|
|
|
776
788
|
log.info({ msg: { b: { c: 'd' } } })
|
|
777
789
|
})
|
|
778
790
|
|
|
779
|
-
|
|
791
|
+
test('prettifies msg object with circular references', (t) => {
|
|
780
792
|
t.plan(7)
|
|
781
793
|
const expectedLines = [
|
|
782
794
|
' msg: {',
|
|
@@ -791,10 +803,10 @@ test('basic prettifier tests', (t) => {
|
|
|
791
803
|
write (chunk, enc, cb) {
|
|
792
804
|
const formatted = pretty(chunk.toString())
|
|
793
805
|
const lines = formatted.split('\n')
|
|
794
|
-
t.
|
|
806
|
+
t.assert.strictEqual(lines.length, expectedLines.length + 2)
|
|
795
807
|
lines.shift(); lines.pop()
|
|
796
808
|
for (let i = 0; i < lines.length; i += 1) {
|
|
797
|
-
t.
|
|
809
|
+
t.assert.strictEqual(lines[i], expectedLines[i])
|
|
798
810
|
}
|
|
799
811
|
cb()
|
|
800
812
|
}
|
|
@@ -805,7 +817,7 @@ test('basic prettifier tests', (t) => {
|
|
|
805
817
|
log.info({ msg })
|
|
806
818
|
})
|
|
807
819
|
|
|
808
|
-
|
|
820
|
+
test('prettifies custom key', (t) => {
|
|
809
821
|
t.plan(1)
|
|
810
822
|
const pretty = prettyFactory({
|
|
811
823
|
customPrettifiers: {
|
|
@@ -814,10 +826,10 @@ test('basic prettifier tests', (t) => {
|
|
|
814
826
|
}
|
|
815
827
|
})
|
|
816
828
|
const arst = pretty('{"msg":"hello world", "foo": "bar", "cow": "moo", "level":30}')
|
|
817
|
-
t.
|
|
829
|
+
t.assert.strictEqual(arst, 'INFO: hello world\n foo: bar_baz\n multiline\n cow: MOO\n')
|
|
818
830
|
})
|
|
819
831
|
|
|
820
|
-
|
|
832
|
+
test('does not add trailing space if prettified value begins with eol', (t) => {
|
|
821
833
|
t.plan(1)
|
|
822
834
|
const pretty = prettyFactory({
|
|
823
835
|
customPrettifiers: {
|
|
@@ -825,10 +837,10 @@ test('basic prettifier tests', (t) => {
|
|
|
825
837
|
}
|
|
826
838
|
})
|
|
827
839
|
const arst = pretty('{"msg":"doing work","calls":["step 1","step 2","step 3"],"level":30}')
|
|
828
|
-
t.
|
|
840
|
+
t.assert.strictEqual(arst, 'INFO: doing work\n calls:\n step 1\n step 2\n step 3\n')
|
|
829
841
|
})
|
|
830
842
|
|
|
831
|
-
|
|
843
|
+
test('does not prettify custom key that does not exists', (t) => {
|
|
832
844
|
t.plan(1)
|
|
833
845
|
const pretty = prettyFactory({
|
|
834
846
|
customPrettifiers: {
|
|
@@ -837,14 +849,14 @@ test('basic prettifier tests', (t) => {
|
|
|
837
849
|
}
|
|
838
850
|
})
|
|
839
851
|
const arst = pretty('{"msg":"hello world", "foo": "bar", "level":30}')
|
|
840
|
-
t.
|
|
852
|
+
t.assert.strictEqual(arst, 'INFO: hello world\n foo: bar_baz\n')
|
|
841
853
|
})
|
|
842
854
|
|
|
843
|
-
|
|
855
|
+
test('prettifies object with some undefined values', (t) => {
|
|
844
856
|
t.plan(1)
|
|
845
857
|
const destination = new Writable({
|
|
846
858
|
write (chunk, _, cb) {
|
|
847
|
-
t.
|
|
859
|
+
t.assert.strictEqual(
|
|
848
860
|
chunk + '',
|
|
849
861
|
`[${formattedEpoch}] INFO (${pid}):\n a: {\n "b": "c"\n }\n n: null\n`
|
|
850
862
|
)
|
|
@@ -866,63 +878,63 @@ test('basic prettifier tests', (t) => {
|
|
|
866
878
|
})
|
|
867
879
|
})
|
|
868
880
|
|
|
869
|
-
|
|
881
|
+
test('ignores multiple keys', (t) => {
|
|
870
882
|
t.plan(1)
|
|
871
883
|
const pretty = prettyFactory({ ignore: 'pid,hostname' })
|
|
872
884
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
873
|
-
t.
|
|
885
|
+
t.assert.strictEqual(arst, `[${formattedEpoch}] INFO: hello world\n`)
|
|
874
886
|
})
|
|
875
887
|
|
|
876
|
-
|
|
888
|
+
test('ignores a single key', (t) => {
|
|
877
889
|
t.plan(1)
|
|
878
890
|
const pretty = prettyFactory({ ignore: 'pid' })
|
|
879
891
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
880
|
-
t.
|
|
892
|
+
t.assert.strictEqual(arst, `[${formattedEpoch}] INFO (on ${hostname}): hello world\n`)
|
|
881
893
|
})
|
|
882
894
|
|
|
883
|
-
|
|
895
|
+
test('ignores time', (t) => {
|
|
884
896
|
t.plan(1)
|
|
885
897
|
const pretty = prettyFactory({ ignore: 'time' })
|
|
886
898
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
887
|
-
t.
|
|
899
|
+
t.assert.strictEqual(arst, `INFO (${pid} on ${hostname}): hello world\n`)
|
|
888
900
|
})
|
|
889
901
|
|
|
890
|
-
|
|
902
|
+
test('ignores time and level', (t) => {
|
|
891
903
|
t.plan(1)
|
|
892
904
|
const pretty = prettyFactory({ ignore: 'time,level' })
|
|
893
905
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
894
|
-
t.
|
|
906
|
+
t.assert.strictEqual(arst, `(${pid} on ${hostname}): hello world\n`)
|
|
895
907
|
})
|
|
896
908
|
|
|
897
|
-
|
|
909
|
+
test('ignores all keys but message', (t) => {
|
|
898
910
|
t.plan(1)
|
|
899
911
|
const pretty = prettyFactory({ ignore: 'time,level,name,pid,hostname' })
|
|
900
912
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
901
|
-
t.
|
|
913
|
+
t.assert.strictEqual(arst, 'hello world\n')
|
|
902
914
|
})
|
|
903
915
|
|
|
904
|
-
|
|
916
|
+
test('include nothing', (t) => {
|
|
905
917
|
t.plan(1)
|
|
906
918
|
const pretty = prettyFactory({ include: '' })
|
|
907
919
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
908
|
-
t.
|
|
920
|
+
t.assert.strictEqual(arst, 'hello world\n')
|
|
909
921
|
})
|
|
910
922
|
|
|
911
|
-
|
|
923
|
+
test('include multiple keys', (t) => {
|
|
912
924
|
t.plan(1)
|
|
913
925
|
const pretty = prettyFactory({ include: 'time,level' })
|
|
914
926
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
915
|
-
t.
|
|
927
|
+
t.assert.strictEqual(arst, `[${formattedEpoch}] INFO: hello world\n`)
|
|
916
928
|
})
|
|
917
929
|
|
|
918
|
-
|
|
930
|
+
test('include a single key', (t) => {
|
|
919
931
|
t.plan(1)
|
|
920
932
|
const pretty = prettyFactory({ include: 'level' })
|
|
921
933
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
922
|
-
t.
|
|
934
|
+
t.assert.strictEqual(arst, 'INFO: hello world\n')
|
|
923
935
|
})
|
|
924
936
|
|
|
925
|
-
|
|
937
|
+
test('log error-like object', (t) => {
|
|
926
938
|
t.plan(7)
|
|
927
939
|
const expectedLines = [
|
|
928
940
|
' type: "Error"',
|
|
@@ -937,10 +949,10 @@ test('basic prettifier tests', (t) => {
|
|
|
937
949
|
write (chunk, enc, cb) {
|
|
938
950
|
const formatted = pretty(chunk.toString())
|
|
939
951
|
const lines = formatted.split('\n')
|
|
940
|
-
t.
|
|
952
|
+
t.assert.strictEqual(lines.length, expectedLines.length + 2)
|
|
941
953
|
lines.shift(); lines.pop()
|
|
942
954
|
for (let i = 0; i < lines.length; i += 1) {
|
|
943
|
-
t.
|
|
955
|
+
t.assert.strictEqual(lines[i], expectedLines[i])
|
|
944
956
|
}
|
|
945
957
|
cb()
|
|
946
958
|
}
|
|
@@ -948,14 +960,14 @@ test('basic prettifier tests', (t) => {
|
|
|
948
960
|
log.error({ type: 'Error', message: 'm', stack: ['line1', 'line2'] })
|
|
949
961
|
})
|
|
950
962
|
|
|
951
|
-
|
|
963
|
+
test('include should override ignore', (t) => {
|
|
952
964
|
t.plan(1)
|
|
953
965
|
const pretty = prettyFactory({ ignore: 'time,level', include: 'time,level' })
|
|
954
966
|
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30}`)
|
|
955
|
-
t.
|
|
967
|
+
t.assert.strictEqual(arst, `[${formattedEpoch}] INFO: hello world\n`)
|
|
956
968
|
})
|
|
957
969
|
|
|
958
|
-
|
|
970
|
+
test('include a single key with null object', (t) => {
|
|
959
971
|
t.plan(1)
|
|
960
972
|
const pretty = prettyFactory({ include: 'level' })
|
|
961
973
|
const obj = new Empty()
|
|
@@ -968,10 +980,10 @@ test('basic prettifier tests', (t) => {
|
|
|
968
980
|
obj,
|
|
969
981
|
level: 30
|
|
970
982
|
})
|
|
971
|
-
t.
|
|
983
|
+
t.assert.strictEqual(arst, 'INFO: hello world\n')
|
|
972
984
|
})
|
|
973
985
|
|
|
974
|
-
|
|
986
|
+
test('prettifies trace caller', (t) => {
|
|
975
987
|
t.plan(1)
|
|
976
988
|
const traceCaller = (instance) => {
|
|
977
989
|
const { symbols: { asJsonSym } } = pino
|
|
@@ -990,7 +1002,7 @@ test('basic prettifier tests', (t) => {
|
|
|
990
1002
|
const log = traceCaller(pino({}, new Writable({
|
|
991
1003
|
write (chunk, enc, cb) {
|
|
992
1004
|
const formatted = pretty(chunk.toString())
|
|
993
|
-
t.
|
|
1005
|
+
t.assert.strictEqual(
|
|
994
1006
|
formatted,
|
|
995
1007
|
`[${formattedEpoch}] INFO (${pid}) </tmp/script.js>: foo\n`
|
|
996
1008
|
)
|
|
@@ -1000,40 +1012,40 @@ test('basic prettifier tests', (t) => {
|
|
|
1000
1012
|
log.info('foo')
|
|
1001
1013
|
})
|
|
1002
1014
|
|
|
1003
|
-
|
|
1015
|
+
test('handles specified timestampKey', (t) => {
|
|
1004
1016
|
t.plan(1)
|
|
1005
1017
|
const pretty = prettyFactory({ timestampKey: '@timestamp' })
|
|
1006
1018
|
const arst = pretty(`{"msg":"hello world", "@timestamp":${epoch}, "level":30}`)
|
|
1007
|
-
t.
|
|
1019
|
+
t.assert.strictEqual(arst, `[${formattedEpoch}] INFO: hello world\n`)
|
|
1008
1020
|
})
|
|
1009
1021
|
|
|
1010
|
-
|
|
1022
|
+
test('keeps "v" key in log', (t) => {
|
|
1011
1023
|
t.plan(1)
|
|
1012
1024
|
const pretty = prettyFactory({ ignore: 'time' })
|
|
1013
1025
|
const log = pino({}, new Writable({
|
|
1014
1026
|
write (chunk, enc, cb) {
|
|
1015
1027
|
const formatted = pretty(chunk.toString())
|
|
1016
|
-
t.
|
|
1028
|
+
t.assert.strictEqual(formatted, `INFO (${pid} on ${hostname}):\n v: 1\n`)
|
|
1017
1029
|
cb()
|
|
1018
1030
|
}
|
|
1019
1031
|
}))
|
|
1020
1032
|
log.info({ v: 1 })
|
|
1021
1033
|
})
|
|
1022
1034
|
|
|
1023
|
-
|
|
1035
|
+
test('Hide object `{ key: "value" }` from output when flag `hideObject` is set', (t) => {
|
|
1024
1036
|
t.plan(1)
|
|
1025
1037
|
const pretty = prettyFactory({ hideObject: true })
|
|
1026
1038
|
const log = pino({}, new Writable({
|
|
1027
1039
|
write (chunk, enc, cb) {
|
|
1028
1040
|
const formatted = pretty(chunk.toString())
|
|
1029
|
-
t.
|
|
1041
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (${pid}): hello world\n`)
|
|
1030
1042
|
cb()
|
|
1031
1043
|
}
|
|
1032
1044
|
}))
|
|
1033
1045
|
log.info({ key: 'value' }, 'hello world')
|
|
1034
1046
|
})
|
|
1035
1047
|
|
|
1036
|
-
|
|
1048
|
+
test('Prints extra objects on one line with singleLine=true', (t) => {
|
|
1037
1049
|
t.plan(1)
|
|
1038
1050
|
const pretty = prettyFactory({
|
|
1039
1051
|
singleLine: true,
|
|
@@ -1046,7 +1058,7 @@ test('basic prettifier tests', (t) => {
|
|
|
1046
1058
|
const log = pino({}, new Writable({
|
|
1047
1059
|
write (chunk, enc, cb) {
|
|
1048
1060
|
const formatted = pretty(chunk.toString())
|
|
1049
|
-
t.
|
|
1061
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (${pid}): message {"extra":{"foo":"bar","number":42},"upper":"FOOBAR"}\n`)
|
|
1050
1062
|
|
|
1051
1063
|
cb()
|
|
1052
1064
|
}
|
|
@@ -1054,25 +1066,25 @@ test('basic prettifier tests', (t) => {
|
|
|
1054
1066
|
log.info({ msg: 'message', extra: { foo: 'bar', number: 42 }, upper: 'foobar', undef: 'this will not show up' })
|
|
1055
1067
|
})
|
|
1056
1068
|
|
|
1057
|
-
|
|
1069
|
+
test('Does not print empty object with singleLine=true', (t) => {
|
|
1058
1070
|
t.plan(1)
|
|
1059
1071
|
const pretty = prettyFactory({ singleLine: true, colorize: false })
|
|
1060
1072
|
const log = pino({}, new Writable({
|
|
1061
1073
|
write (chunk, enc, cb) {
|
|
1062
1074
|
const formatted = pretty(chunk.toString())
|
|
1063
|
-
t.
|
|
1075
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (${pid}): message\n`)
|
|
1064
1076
|
cb()
|
|
1065
1077
|
}
|
|
1066
1078
|
}))
|
|
1067
1079
|
log.info({ msg: 'message' })
|
|
1068
1080
|
})
|
|
1069
1081
|
|
|
1070
|
-
|
|
1082
|
+
test('default options', (t) => {
|
|
1071
1083
|
t.plan(1)
|
|
1072
|
-
t.doesNotThrow(pinoPretty)
|
|
1084
|
+
t.assert.doesNotThrow(pinoPretty)
|
|
1073
1085
|
})
|
|
1074
1086
|
|
|
1075
|
-
|
|
1087
|
+
test('does not call fs.close on stdout stream', (t) => {
|
|
1076
1088
|
t.plan(2)
|
|
1077
1089
|
const destination = pino.destination({ minLength: 4096, sync: true })
|
|
1078
1090
|
const prettyDestination = pinoPretty({ destination, colorize: false })
|
|
@@ -1094,11 +1106,11 @@ test('basic prettifier tests', (t) => {
|
|
|
1094
1106
|
})
|
|
1095
1107
|
destination.end()
|
|
1096
1108
|
Object.assign(fs, { close, writeSync })
|
|
1097
|
-
t.match(chunks.join(''), /INFO .+: this message has been buffered/)
|
|
1098
|
-
t.
|
|
1109
|
+
t.assert.match(chunks.join(''), /INFO .+: this message has been buffered/)
|
|
1110
|
+
t.assert.strictEqual(closeCalled, false)
|
|
1099
1111
|
})
|
|
1100
1112
|
|
|
1101
|
-
|
|
1113
|
+
test('wait for close event from destination', (t, end) => {
|
|
1102
1114
|
t.plan(2)
|
|
1103
1115
|
const destination = pino.destination({ minLength: 4096, sync: true })
|
|
1104
1116
|
const prettyDestination = pinoPretty({ destination, colorize: false })
|
|
@@ -1116,7 +1128,7 @@ test('basic prettifier tests', (t) => {
|
|
|
1116
1128
|
return args[1].length
|
|
1117
1129
|
}
|
|
1118
1130
|
})
|
|
1119
|
-
t.
|
|
1131
|
+
t.after(() => {
|
|
1120
1132
|
Object.assign(fs, { close, writeSync })
|
|
1121
1133
|
})
|
|
1122
1134
|
let destinationClosed = false
|
|
@@ -1124,16 +1136,17 @@ test('basic prettifier tests', (t) => {
|
|
|
1124
1136
|
destinationClosed = true
|
|
1125
1137
|
})
|
|
1126
1138
|
prettyDestination.on('close', () => {
|
|
1127
|
-
t.match(chunks.join(''), /INFO .+: this message has been buffered/)
|
|
1128
|
-
t.
|
|
1139
|
+
t.assert.match(chunks.join(''), /INFO .+: this message has been buffered/)
|
|
1140
|
+
t.assert.strictEqual(destinationClosed, true)
|
|
1141
|
+
end()
|
|
1129
1142
|
})
|
|
1130
1143
|
prettyDestination.end()
|
|
1131
1144
|
})
|
|
1132
1145
|
|
|
1133
|
-
|
|
1146
|
+
test('stream usage', async (t) => {
|
|
1134
1147
|
t.plan(1)
|
|
1135
|
-
const tmpDir =
|
|
1136
|
-
t.
|
|
1148
|
+
const tmpDir = join(__dirname, '.tmp_' + Date.now())
|
|
1149
|
+
t.after(() => rimraf.sync(tmpDir))
|
|
1137
1150
|
|
|
1138
1151
|
const destination = join(tmpDir, 'output')
|
|
1139
1152
|
|
|
@@ -1155,13 +1168,13 @@ test('basic prettifier tests', (t) => {
|
|
|
1155
1168
|
|
|
1156
1169
|
const formatted = fs.readFileSync(destination, 'utf8')
|
|
1157
1170
|
|
|
1158
|
-
t.
|
|
1171
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (${pid}): message {"extra":{"foo":"bar","number":42},"upper":"FOOBAR"}\n`)
|
|
1159
1172
|
})
|
|
1160
1173
|
|
|
1161
|
-
|
|
1174
|
+
test('sync option', async (t) => {
|
|
1162
1175
|
t.plan(1)
|
|
1163
|
-
const tmpDir =
|
|
1164
|
-
t.
|
|
1176
|
+
const tmpDir = join(__dirname, '.tmp_' + Date.now())
|
|
1177
|
+
t.after(() => rimraf.sync(tmpDir))
|
|
1165
1178
|
|
|
1166
1179
|
const destination = join(tmpDir, 'output')
|
|
1167
1180
|
|
|
@@ -1182,10 +1195,10 @@ test('basic prettifier tests', (t) => {
|
|
|
1182
1195
|
|
|
1183
1196
|
const formatted = fs.readFileSync(destination, 'utf8')
|
|
1184
1197
|
|
|
1185
|
-
t.
|
|
1198
|
+
t.assert.strictEqual(formatted, `[${formattedEpoch}] INFO (${pid}): message {"extra":{"foo":"bar","number":43},"upper":"foobar"}\n`)
|
|
1186
1199
|
})
|
|
1187
1200
|
|
|
1188
|
-
|
|
1201
|
+
test('support custom colors object', async (t) => {
|
|
1189
1202
|
t.plan(1)
|
|
1190
1203
|
const pretty = prettyFactory({
|
|
1191
1204
|
colorize: true,
|
|
@@ -1201,7 +1214,7 @@ test('basic prettifier tests', (t) => {
|
|
|
1201
1214
|
const log = pino({}, new Writable({
|
|
1202
1215
|
write (chunk, enc, cb) {
|
|
1203
1216
|
const formatted = pretty(chunk.toString())
|
|
1204
|
-
t.
|
|
1217
|
+
t.assert.strictEqual(
|
|
1205
1218
|
formatted,
|
|
1206
1219
|
`[${formattedEpoch}] \u001B[32mINFO\u001B[39m (${pid}): \u001B[36mfoo\u001B[39m\n`
|
|
1207
1220
|
)
|
|
@@ -1211,31 +1224,29 @@ test('basic prettifier tests', (t) => {
|
|
|
1211
1224
|
log.info('foo')
|
|
1212
1225
|
})
|
|
1213
1226
|
|
|
1214
|
-
|
|
1227
|
+
test('check support for colors', (t) => {
|
|
1215
1228
|
t.plan(1)
|
|
1216
1229
|
const isColorSupported = pinoPretty.isColorSupported
|
|
1217
|
-
t.
|
|
1230
|
+
t.assert.strictEqual(typeof isColorSupported, 'boolean')
|
|
1218
1231
|
})
|
|
1219
|
-
|
|
1220
|
-
t.end()
|
|
1221
1232
|
})
|
|
1222
1233
|
|
|
1223
1234
|
if (semver.gte(pino.version, '8.21.0')) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1235
|
+
describe('using pino config', () => {
|
|
1236
|
+
beforeEach(() => {
|
|
1226
1237
|
Date.originalNow = Date.now
|
|
1227
1238
|
Date.now = () => epoch
|
|
1228
1239
|
})
|
|
1229
|
-
|
|
1240
|
+
afterEach(() => {
|
|
1230
1241
|
Date.now = Date.originalNow
|
|
1231
1242
|
delete Date.originalNow
|
|
1232
1243
|
})
|
|
1233
1244
|
|
|
1234
|
-
|
|
1245
|
+
test('can use different message keys', (t) => {
|
|
1235
1246
|
t.plan(1)
|
|
1236
1247
|
const destination = new Writable({
|
|
1237
1248
|
write (formatted, enc, cb) {
|
|
1238
|
-
t.
|
|
1249
|
+
t.assert.strictEqual(
|
|
1239
1250
|
formatted.toString(),
|
|
1240
1251
|
`[${formattedEpoch}] INFO (${pid}): baz\n`
|
|
1241
1252
|
)
|
|
@@ -1250,11 +1261,11 @@ if (semver.gte(pino.version, '8.21.0')) {
|
|
|
1250
1261
|
log.info({ bar: 'baz' })
|
|
1251
1262
|
})
|
|
1252
1263
|
|
|
1253
|
-
|
|
1264
|
+
test('handles customLogLevels', (t) => {
|
|
1254
1265
|
t.plan(1)
|
|
1255
1266
|
const destination = new Writable({
|
|
1256
1267
|
write (formatted, enc, cb) {
|
|
1257
|
-
t.
|
|
1268
|
+
t.assert.strictEqual(
|
|
1258
1269
|
formatted.toString(),
|
|
1259
1270
|
`[${formattedEpoch}] TESTCUSTOM (${pid}): test message\n`
|
|
1260
1271
|
)
|
|
@@ -1268,8 +1279,6 @@ if (semver.gte(pino.version, '8.21.0')) {
|
|
|
1268
1279
|
const log = pino({ customLevels: { testCustom: 35 } }, pretty)
|
|
1269
1280
|
log.testCustom('test message')
|
|
1270
1281
|
})
|
|
1271
|
-
|
|
1272
|
-
t.end()
|
|
1273
1282
|
})
|
|
1274
1283
|
}
|
|
1275
1284
|
|