28 Commits

Author SHA1 Message Date
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
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
Ilia Baryshnikov
b288da554e
feat: add errorKey option (#1507) 2022-08-04 22:49:42 +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
Alex Pavlov
83f95842c7
add option mixinMergeStrategy (to v7) (#1336) 2022-02-15 16:56:37 +01: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
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
James Sumners
8872c6ccb9
Implement a log method hook 2020-04-01 19:17:26 -04:00
Tomas Della Vedova
f3ab176c90
Add formatters for core log components (#775)
* WIP: added bindings and levels serializers

* Addressed comments

* Fixed test

* Moved from custom srializers to formatters

* Use stricter check in genLsCache

* Updated test

* Addressed comments

* Added log formatter and removed pino.* serializer

* Updated test

* Use factory for formatters object

* Added deprecations messages
- deprecated useLevelLabels
- deprecated changeLevelName
- deprecated pino.* serializer

* Updated test

* Addressed comments

* Fix test

* Improve code coverage

* Fixed levelKey handling

* Updated test

* Addressed comments

* Updated test

* Added formatters benchmarks

* Rename test

* 100% code coverage

* Added formatters to benchmark runner

* Updated documentation

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Update docs/api.md

Co-Authored-By: James Sumners <james@sumners.email>

* Addressed comments

Co-authored-by: James Sumners <james@sumners.email>
Co-authored-by: Matteo Collina <hello@matteocollina.com>
2020-03-18 14:18:02 +01:00
Andrew van Rooyen
72eb875edc
Deprecate the changeLevelName option and alias it to levelKey (#772)
* deprecate the `changeLevelName` option and alias it to `levelKey`

* use process.emitWarning instead of console.warn for deprecation message

* avoid accessing private state in changeLevelName deprecation test
2020-02-28 19:11:47 +01:00
Matthew Adams
5d35a08d86 objectKey -> nestedKey, no "you" in docs 2020-01-07 11:06:14 -06:00
Matthew Adams
be9464a4a5 support objectKey config 2020-01-06 18:46:42 -06:00
Thomas Watson
f66326a3ac
feat(mixin): add mixin config option (#741) 2019-11-21 08:05:05 +01:00
Ilya Moskalev
3c7f3012bb more careful timestamp extraction (#675) 2019-07-17 13:04:24 +02:00
Krisztina Hirth
e3866516b1 Fix bug Global serializer not invoked for strings when base: null (#597)
* Fix bug Global serializer not invoked for strings when `base: null`

* Remove unused symbol

* remove sting interpolation

Co-Authored-By: yellowbrickc <yellowbrickc@users.noreply.github.com>

* Instead of cloning the object parameter, the messageKey prop will be set if needed.
2019-03-27 11:45:37 +01:00
n4zukker
b2fa1e3328 Leading wildcard (#587)
* Support redact paths which start with "*."

* Support redact paths which start with "*." add test

* Get back to 100% coverage
2019-01-18 16:46:52 -05:00
Arun Ranganathan
e870ff3811 Allow custom levels to override default and allow to remove default levels (#515) 2018-09-16 20:53:22 +02:00
Arun Ranganathan
e6d8585c54 Add ability to change level name when creating the instance (#503) 2018-08-26 00:15:11 +02:00
James Sumners
72efea4d95
Add useLevelLabels option (#492)
* Add useLevelLabels option

* Add test for children writing level labels
2018-08-19 09:15:07 -04:00
Matteo Collina
f421431d55
Symbol.for('pino.serializers') is part of the public API (#487)
* Symbol.for('pino.serializers') is part of the public API

Fixes https://github.com/pinojs/hapi-pino/issues/62

* typo: Logger -> logger

* Dave fixes
2018-08-14 23:53:46 +02:00
davidmarkclements
d4b41cebb4 pino.final 2018-07-18 15:59:17 +02:00
davidmarkclements
164120042c custom levels - closes #446 2018-07-14 00:46:58 +02:00
davidmarkclements
66d7789dc0 rename needsMetadata symbol to pino.metadata 2018-07-10 13:53:33 +02:00
davidmarkclements
ff31f4ed33 all undocumented state now private as symbol keys 2018-06-11 22:02:55 +02:00
davidmarkclements
cd95b7df3a privatize serializer state 2018-06-11 21:22:22 +02:00
davidmarkclements
f8877f1400 consistent exports, redact symbol tidy 2018-06-11 21:01:49 +02:00
davidmarkclements
5b86be0bbf privatize undocumented but non-underscore prefixed methods 2018-06-11 17:53:08 +02:00
davidmarkclements
d29fa7e482 no underscore prefixed properties, private state and methods using symbols 2018-06-11 17:00:43 +02:00