149 Commits

Author SHA1 Message Date
Sam Chung
d376e959b6
feat(types): add LogFnFields interface (#2254) 2025-10-03 02:23:31 -07:00
Francesco Maida
feef9ac768
feat: added timestamp rfc3339 format with nanoseconds (#2251)
* feat: added timestamp rfc3339 format with nanoseconds

* chore: updated docs and tests

* Update lib/time.js

Co-authored-by: Andrea Carraro <toomuchdesign@users.noreply.github.com>

* feat: updated and improved fn performance, fixed types

* chore: updated docs and tests

* chore: fixed leftover test comment

---------

Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
Co-authored-by: Andrea Carraro <toomuchdesign@users.noreply.github.com>
2025-09-18 06:32:21 -04:00
Matteo Collina
57f14c1e1d
fix: TypeScript regression with boolean values in %s placeholders (#2262)
* fix: TypeScript regression with boolean values in %s placeholders

Fixes #2259 - TypeScript regression introduced in v9.9.0 where boolean
values could not be used with %s placeholders in logging methods.

The %s placeholder now correctly accepts all primitive types (string,
number, boolean, bigint, null, undefined, symbol) as it should, matching
the runtime behavior where these values are converted to strings.

- Updated PlaceholderTypeMapping to allow all primitives for %s
- Added comprehensive test coverage for all primitive types with %s
- Removed incorrect type error expectations for boolean and number with %s

* fix docs

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

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
2025-09-03 00:38:58 -07:00
Paolo Insogna
2583a6544f
feat: Added remove to multistream. (#2257)
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
2025-08-13 11:08:22 +02:00
Fedor Indutny
4605454f77
feat: introduce logger.msgPrefix getter (#2232)
* feat: introduce `logger.msgPrefix` getter

When creating a logger or a child logger API allows providing
`msgPrefix` string that gets appended to every formatted log line.
However, there is no way to get this string from existing logger
instance which makes it inaccessible from within the `hooks.logMethod`.

This commit adds the getter method and types for `logger.msgPrefix`.

* add test

* Add docs
2025-08-07 06:11:13 -07:00
Matteo Collina
8ab2971b9f
Document that the error event on the thread stream is fatal (#2116)
* Document that the error event on the thread stream is fatal

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

* Update api.md

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

* Update docs/api.md

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

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
Co-authored-by: Igor Savin <iselwin@gmail.com>
Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>
2025-01-16 08:14:01 -08:00
osher
16ef66dd5f
Update api.md - typo in default of options.base (#2113) 2024-12-25 10:37:20 -05:00
Theo Ephraim
bb1f89dbd9
add new streamWrite hook (#2105) 2024-12-14 17:17:17 +01:00
Cangit
bd2fb33597
chore: use node: imports (#2003)
* chore: use node: imports

* missing esm style import
2024-07-12 06:48:44 -04:00
Daniele Bacarella
8a20d79e67
Adding support for mix&match pipelines (#1954)
* added tests

* Added test

* Implemented support for named 'pipelines' property in pino.transport

* Updated pino.d.ts and api.md to include pipeline within targets

* - Reverted changes related to the support of named pipelines
- Implemented support for mixed target&pipeline definitions  within `targets` in `transport.js`
- Merged logic from both `worker.js` and `worker-pipeline.js` into `worker.js`
- Fixed `pipeline.test.js`
- Fixed docs to reflect changes above

TODO:
 - Remove `worker-pipeline.js`
 - Fix `transport.js` to use only `worker.js`
 - Fix related docs
 - Fix UTs

* - Removed `worker-pipeline.js`
- Updated docs to remove mentions of `worker-pipeline.js`
- Fixed failing UTs
- Fixed `transport.js` to use only `worker.js` also when `pipeline` is defined
- Fixed `worker.js` to work properly when only `pipeline` is defined

* added a simple flow schema to worker.js

* added a simple flow schema to worker.js

* Added a special case in worker.js to skip the multistream instance when a single target or pipeline is defined

* - Added optional 'level' property to TransportPipelineOptions interface
- A level can now be defined for pipelines defined inside 'targets'
- Added UT in 'pipeline.test.js' to check expected behaviour with 'dedupe'
2024-05-13 13:02:57 +02:00
Alec Mev
36399faae5 Document setBindings 2024-03-19 08:58:19 -04:00
homersimpsons
608d55b529
api.md: Fix link declaration (#1900) 2024-02-07 09:01:44 -05:00
obrus-corcentric
384df31c87
Add ability to override custom levels comparison (#1883)
* feat: add ability to override custom levels compare

* fix: use function instead of closure

* docs: update level comparison to docs

* test: update types tests for level comparison

* refactor: move default levels and sorting order to constants

* fix: made suggested changes in pr review

* fix: change enum annotation type
2024-02-01 15:16:55 +01:00
codershiba
89fc326c7a
fix: destination docs and types (#1881) 2024-01-13 22:11:30 +01:00
Raz Luvaton
19ab286a82
allow passing callback to flush (#1827)
* allow passing callback to flush

* Update api.md

* Update docs/api.md

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

* update sonic boom with the latest fix

---------

Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>
2023-10-09 20:59:47 +02:00
Artrix
713c3c4bb4
Fix improperly placed quote (#1810) 2023-09-15 14:56:51 -04:00
mary marchini
962bc2b04f
feat: pass logger/child logger as param to mixin (#1709) 2023-05-05 08:32:34 +02:00
Nadhif Ikbar Wibowo
513e10f2d2
docs: bindings formatter function usage (#1702) 2023-05-02 17:39:24 +02:00
Jan Beseda
eafbc906a0
fix(docs): update multistream example and description (#1649) 2023-02-17 21:36:14 +01:00
Albert Kaaman
5dd282cfe7
feat: add dedupe option to transport (#1640)
* feat: add dedupe option to transport

* docs: add transport dedupe info
2023-02-09 09:12:27 -05: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
SM KHOBAIB ALAM
907403b35c
Fix documentation example (#1608) 2022-12-22 08:15:45 -05:00
AJ Bienz
7a3df5ff2c
Pass logger instance as an argument in level-change event (#1576)
* include logger instance in `level-change` event

* updating types
2022-10-20 11:46:22 +02:00
Frazer Smith
73678ffd5b
docs: grammar and spelling fixes (#1560)
* docs: grammar and spelling fixes

* docs: more fixes
2022-09-16 11:48:44 +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
Ilia Baryshnikov
b288da554e
feat: add errorKey option (#1507) 2022-08-04 22:49:42 +02:00
Jonathan Giroux (Koltes)
ddc762c124
docs(API): add a description to level option (#1488) 2022-07-08 13:05:15 +02:00
Jack
ab96a7c06d
docs: add note about nestedKey to mixin section (#1444) 2022-06-01 13:03:58 +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
Josh Soref
174723eabc
Spelling (#1427) 2022-05-01 21:30:58 +02:00
Tobias Nießen
593fd160d8
doc: fix typo in clone(level) (#1423) 2022-04-30 19:38:32 +02:00
jordigh
85ace7f9a2
api.md: fix typo
Leg levels sounds interesting, but I'm sure we're talking about log levels here.
2022-04-13 10:34:26 -04:00
techmunk
6fbd2fb25f
feat: add level number to mixin callback (#1364) 2022-03-13 19:12:14 +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
Daniele Bacarella
5d8eb71976
Added documentation for MultiStreamRes, StreamEntry, DestinationStream and Level (#1342)
* Added documentation about MultiStreamRes, StreamEntry, DestinationStream and Level

* fix branching in multistream#add
2022-02-17 18:11:39 +01:00
Alex Pavlov
83f95842c7
add option mixinMergeStrategy (to v7) (#1336) 2022-02-15 16:56:37 +01:00
Dan Jenkins
59a3e09591
fix error in example 2022-01-26 13:06:24 +00:00
James Sumners
4b0009e9f2
Coerce string integer destinations to file descriptors (#1180) 2021-11-22 09:08:43 +01:00
Dan Allen
f649bfa9de consistently use the term mergingObject in the docs 2021-11-21 03:41:43 -07:00
Matteo Collina
1726618447
Improve docs and deprecation about prettyPrint (#1203) 2021-11-01 08:16:22 +01:00
choinker
c682641c01 address destination param options 2021-10-26 09:30:08 -07: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
Matteo Collina
8b9311737e
Bring the asynchronous logging doc up to v7 (#1171) 2021-10-19 12:59:59 +02:00
Matteo Collina
59ac907d09 Add caller option to transport 2021-10-13 15:35:52 +02:00
Jorge Barnaby
aa605ea878
Update api.md 2021-10-10 10:59:23 -04:00
Matteo Collina
777b99f7c4
Transport pipeline (#1143)
* refactored transport tests

* Added pipeline to transport

* Maybe node v12

* transform -> enablePipelining

* Added docs

* Update docs/transports.md

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

* Clarify pino/file writes to stdout

* Bumped pino-abstract-transport.

Co-authored-by: James Sumners <james@sumners.email>
2021-10-03 00:24:51 +02:00
Justin Page
6db9d59216
Remove whitespace from markdown files (#1131) 2021-09-17 08:40:14 +02:00
Matteo Collina
8fb98cef1c
Removed multistream prettyPrint deprecation and clean up docs (#1123)
* Removed multistream prettyPrint deprecation and clean up docs

* Update docs/api.md

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

Co-authored-by: James Sumners <james@sumners.email>
2021-09-13 18:13:32 +02:00