* 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>
* 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
* 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>
* 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'
* 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
* 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>
* 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>
* 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>
* 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>