144 Commits

Author SHA1 Message Date
Robert Nagy
14d6da548a
perf: use JSON.stringify in fast path for node v25+ (#2330) 2025-10-26 13:30:40 +00:00
Mallepally Lokeshwar Reddy
b2c1408701
chore(lint): migrate from standard to neostandard & upgrade eslint to v9 (#2316) 2025-10-06 09:00:01 -04:00
James Sumners
41d1706410
Convert tests to node:test (#2299)
* Convert tests to node:test

* broken-pipe.test.js

* browser-is-level-enabled.test.js

* complex-objects.test.js

* crlf.test.js

* custom-levels.test.js

* error.test.js

* error-key.test.js

* escaping.test.js

* exit.test.js

* formatters.test.js

* hooks.test.js

* http.test.js

* is-level-enabled.test.js

* levels.test.js

* metadata.test.js

* mixin.test.js

* mixin-merge-strategy.test.js

* multistream.test.js

* redact.test.js

* serializers.test.js

* stdout-protection.test.js

* syncfalse.test.js

* timestamp.test.js

* timestamp-nano.test.js

* transport-stream.test.js

* esm/*

* internals/version.test.js

* transport/big.test.js

* transport/bundlers-support.test.js

* transport/caller.test.js

* transport/core.test.js

* transport/core.transpiled.test.js

* transport/module-link.test.js

* transport/pipeline.test.js

* transport/repl.test.js

* transport/sync-false.test.js

* transport/sync-true.test.js

* transport/targets.test.js

* transport/uses-pino-config.test.js

* clean helper

* finalize

* restore transport/core.test.js

* address feedback

* skip broken-pipe in CITGM

* remove unused package

* remove duplicate test file
2025-10-03 06:12:54 -04:00
Robert Nagy
d11abf5f69
perf: optimize .child (#2300)
* perf: optimize .child

* Update lib/proto.js

Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>

---------

Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>
2025-10-02 06:39:47 -04:00
Arya
991a5f9437
fix: gracefully handle missing diagChannel.tracingChannel on Node < 18.19 (#2290) 2025-09-20 14:55:24 +02:00
James Sumners
72df513a4f
Add tracing channels (#2281) 2025-09-15 12:37:48 -04:00
Matteo Collina
c82003b1a1
The finalization registry bug has been fixed everywhere (#2220) 2025-05-17 16:44:57 +02:00
Matteo Collina
8465234fb1
Disable FinalizationRegistry if node code coverage is active (#1819) 2023-10-01 11:54:45 +02:00
tzviki
da75c01230
adding asString to the key (#1779) 2023-08-10 13:56:23 +02:00
Raz Luvaton
acaad23b8c
Allow message prefix - #544 (#1635)
* allow message prefix WIP

* fix tests

* trigger ci

* add tests

* added docs

* added support for msgPrefix for the root logger

* Update docs/api.md

Co-authored-by: James Sumners <james@sumners.email>

* revert change based on benchmark

---------

Co-authored-by: James Sumners <james@sumners.email>
2023-02-06 11:40:57 +01:00
zahar517
869f7bbf8e
fix: update errorKey with default error serializer (#1593) (#1604)
Co-authored-by: zahar517 <zahar.d517@gmail.com>
2022-12-14 14:06:05 +01:00
sun0day
e6d355cd77
fix(tools): log[level] compatible with when first argument is undefined (fix #1555) (#1565) 2022-09-27 12:25:17 +02:00
Diabl0269
553c66ba3e
Added onChild callback with tests and documentation (#1541)
* Added `onChild` callback with tests and documentation

* Update `onChild` type to also be in options and added types tests

* Apply suggestions from code review

Co-authored-by: James Sumners <james@sumners.email>

* updated documentation

* Updated documentation. 

Expanded `onChild` documentation to mention the function doesn't handle errors

Co-authored-by: James Sumners <james@sumners.email>
2022-09-05 10:12:38 +02:00
Matteo Collina
6d0a310e4e
Remove all mentions of final (#1544)
Signed-off-by: Matteo Collina <hello@matteocollina.com>

Signed-off-by: Matteo Collina <hello@matteocollina.com>
2022-09-01 12:26:00 +02:00
Matteo Collina
4d72bcdb1b
Default fd=1 in pino.destination if stdout has no file descriptor (#1517)
Signed-off-by: Matteo Collina <hello@matteocollina.com>

Signed-off-by: Matteo Collina <hello@matteocollina.com>
2022-08-12 15:52:59 +02:00
Matteo Collina
29911abade
Do not assume process.stdout has a file descriptor (#1503)
* Do not assume process.stdout has a file descriptor

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>
2022-07-24 21:36:29 +02:00
Matteo Collina
55e25f85f7
Use process.stdout if specified by the developer (#1499)
* Use process.stdout if specified by the developer

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup: add test

Signed-off-by: Matteo Collina <hello@matteocollina.com>
2022-07-21 16:21:15 +02:00
Matteo Collina
171e102d9b
Async by default (#1448)
* Remove prettyPrint option.

100% code coverage back.

* Remove pino.final

* Fix jsdom TS issue

* Restore lost error

* Add link to pino-pretty

* Update Node.js in workflows

* Async loggic by default

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* Update docs/asynchronous.md

Co-authored-by: Igor Savin <iselwin@gmail.com>

* Update docs/asynchronous.md

Co-authored-by: Igor Savin <iselwin@gmail.com>

* Update docs/asynchronous.md

Co-authored-by: James Sumners <james@sumners.email>

* fix flaky test

Signed-off-by: Matteo Collina <hello@matteocollina.com>

Co-authored-by: Igor Savin <iselwin@gmail.com>
Co-authored-by: James Sumners <james@sumners.email>
2022-06-01 08:27:43 +02:00
Matteo Collina
ff1546b8bb
Remove deprecated API and options in v7 option. (#1249)
* Remove prettyPrint option.

100% code coverage back.

* Remove pino.final

* Fix jsdom TS issue

* Restore lost error

* Add link to pino-pretty

* Update Node.js in workflows

Co-authored-by: Igor Savin <iselwin@gmail.com>
2022-06-01 00:25:55 +02:00
Christian Savard
03bb312e96
Add option to pass custom levels down to multistream() from transport (#1398)
* add option to pass down custom levels to multistream

* fix types

* update docs

* add test for types

* combine custom with default levels when useOnlyCustomLevels is not set

* add tranport test
2022-04-08 23:35:33 +02:00
Josh Kelley
572ac0a2c0
Fix hasOwnProperty usage (#1359) 2022-03-23 22:58:06 +01:00
Guilherme Kammsetzer
39204eaffb
fix: Throw when using custom level formatters with multiple transports (#1353) (#1362) 2022-03-09 10:36:11 +01:00
ZYSzys
bc3dd5de84
chore: simplify formatters normalize (#1294) 2022-01-08 12:27:01 +01:00
KaKa
6d4144aad0
fix: passing stream to transport (#1286)
* fix: passing stream to transport

* fix: opts.transport checking
2021-12-30 12:35:15 +01:00
James Sumners
4b0009e9f2
Coerce string integer destinations to file descriptors (#1180) 2021-11-22 09:08:43 +01:00
Sameer Srivastava
6c538159dc
Deprecation warning for pino.final() in Node v14+ (#1199) 2021-11-02 17:09:11 +01:00
Sameer Srivastava
43906c71e7
Fixes issue with nested keys (#1198)
* fix: fixes issue with nested keys

* chore: use strictSame in nested key test
2021-10-29 15:10:35 +02:00
Sameer Srivastava
f16c98d7d7
Fix max-depth using safe-stable-stringify (#1169)
* fix: max-depth specified for stringifying

* chore: Added options to set custom limits

* chore: removed console.log

* chore: per-base-logger safe stringify

* types removed
docs updated

* unused json-stringify-safe removed

* test for non circular objects

* chore: updated docs

* chore: doc update for arrays
2021-10-26 14:26:14 +02:00
Etienne de Dieuleveult
1ea480e6f2
fix formatters when used along transport (#1162) 2021-10-15 17:23:12 +02:00
Matteo Collina
59ac907d09 Add caller option to transport 2021-10-13 15:35:52 +02:00
Matteo Collina
e9eb267d38
Correctly select the correct file when using the transport option (#1147) 2021-10-07 14:48:27 +02:00
javiertury
a802d5e591
fix: make pino.final sync flushes when no handler provided (#1126) (#1127)
* fix: make pino.final sync flushes when no handler provided (#1126)

* refactor(final): remove unused error in catch

Co-authored-by: James Sumners <james@sumners.email>

Co-authored-by: James Sumners <james@sumners.email>
2021-09-13 15:19:40 +02:00
Manuel Spigolon
bd67ef93bf
add transports constructor option (#1111)
* add transports constructor option

* rename option

* docs: add transport option

* fix tests

* Apply suggestions from code review

Co-authored-by: Matteo Collina <matteo.collina@gmail.com>

* docs: add more examples

* Apply suggestions from code review

Co-authored-by: James Sumners <james@sumners.email>

* Apply suggestions from code review

Co-authored-by: David Mark Clements <david.mark.clements@gmail.com>

* Apply suggestions from code review

Co-authored-by: James Sumners <james@sumners.email>

* fix test

Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
Co-authored-by: James Sumners <james@sumners.email>
Co-authored-by: David Mark Clements <david.mark.clements@gmail.com>
2021-09-08 18:26:11 +02:00
Matteo Collina
f78dd5ca75
Deprecate the prettyPrint option (#1122) 2021-09-08 13:13:02 +02:00
Matteo Collina
f712a52e05
pino-pretty transport convertion (#1110)
* partial transport convertion

* some code coverage

* fixed type tests

* use pino/file instead of #pino/file

* tiny fixes

* Fixed docs
2021-09-06 15:46:43 +02:00
Matteo Collina
67ceb5f509
Automatically flush the logs on exit in Node v14+ (#1091) 2021-08-20 15:50:52 +02:00
Matteo Collina
60193825cf
Completely removed extreme mode (#1090) 2021-08-19 14:57:09 +02:00
Matteo Collina
16f1f0a66d
Replace fast-safe-stringify with json-stringify-safe (#1066)
Fixes https://github.com/pinojs/pino/issues/1062
2021-07-12 14:22:23 +02:00
Matteo Collina
849f65aab4
pino.transport() (#1003) 2021-07-03 15:48:18 +02:00
Matteo Collina
3c0613a291 Merge branch 'master' into next 2021-05-22 15:43:31 +02:00
mihai1voicescu
75a54cf427
Make the nestedKey only take effect in the serialized object and fix … (#885)
* Make the nestedKey only take effect in the serialized object and fix error detection and serialization (closes #883)

proto.js
* Copy the message property in case the obj is an error and there is a msg specified
* Load the msg as a property of obj if metadata is needed

symbols.js
* Add nestedKeyStrSym to quickly cache the string

tools.js
* Manually build the stringify for performance reasons (not too pretty...)

error.test.js + serializers.test.js
* Add a test for the new nestedKey interaction

* Add tests to complete the coverage

* Address PR notes

* Fix test title

* Fix tests

Co-authored-by: Mihai Voicescu <mihaivo@intern.pch>
2021-05-19 10:00:13 +02:00
Matus Sabo
379e57cbc8
fix: prettyPrint options - misleading error message with wrong option value (#1012)
* fix: prettyPrint options - misleading error message with wrong options value

* fix: rewrite throws in tests - remove unnecessary code and make code more readable
2021-04-16 17:30:11 +02:00
Matteo Collina
cba70129a8 Merge branch 'master' into next 2021-04-06 18:45:21 +02:00
salesh
dfe518b4b6 Fix linter 2021-01-15 20:01:26 +01:00
salesh
98e31c0057 Fix for...in 2021-01-15 19:16:34 +01:00
salesh
2fd82b761f Replacing var with let/const, somewhere left var because scope, somewhere left var because for + resolved all standard issues 2021-01-13 23:52:56 +01:00
Dong Yun
24c493baa0
access log level in hook #909 (#944)
* feat: add level param for hook #909

* chore: add unit test
2020-12-31 11:37:29 +01:00
Matteo Collina
546616fcaa Apply err serializer everywhere. (#896)
* Apply err serializer everywhere.

* Handle cases where the err serializer is not set

* Added docs

* Typo
2020-12-13 15:07:35 +01:00
Jafer Khan
596c98f99e Eliminate quotes from ISO time 2020-09-10 03:33:29 +05:00
James Sumners
f8bf228056 Revert "Avoid data loss with conflictig 'msg' values. (#876)"
This reverts commit d5a13227f91a66ba04fbd713c4a08b46e8a1f991.
2020-07-31 18:16:07 -04:00