67 Commits

Author SHA1 Message Date
Matteo Collina
cf070afecb Fixes after landing 2019-03-27 11:53:51 +01: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
Thomas Thiebaud
1ac1576e70 Fix message precedence over mergedObject 2019-03-22 15:50:31 +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
Chris Walker
1afe9d260c fix invalid JSON when redact.remove acts on chindings (#570)
* add failing test for redact.remove on child logger

* fix throw when `redact.remove` acts on chindings

The previous commit holds the failing test case.
This commit fixes the issue, passing the test.

The issue was that using `redact.remove` on a key that was
subsequently used in a child binding, was cause logging on
the child logger to produce JSON with `"key":undefined` in it.

While this doesn't crash the logger, the JSON is invalid and therefore
will break many recieving systems, at best causing logs to be missed.

In the test suite, the output is `JSON.parse`d which throws due to the
invalid output.
2018-12-21 14:15:15 +01:00
Matteo Collina
e1c9528590 Remove lambda hack, as it is not needed anymore with sync destination 2018-12-11 11:06:45 +01:00
Matteo Collina
10536b0680 Make pino.destination sync 2018-12-09 16:45:40 +01:00
Nathan Woltman
155d75ed11 Simplify switch statement (#550)
Both the 'undefined' and 'function' cases can be handled in the same way.
2018-11-22 18:14:28 +01:00
Matteo Collina
ab39407437
do not crash on broken pipe, just redirect to /dev/null (#540)
* do not crash on broken pipe, just redirect to /dev/null

* 100% code coverage
2018-11-06 09:07:01 +00:00
Matteo Collina
7010b5fffb
Makes final warn that is not supported instead of throwing (#528)
* Makes final warn that is not supported instead of throwing

* Warn inside pretty, not in final.

* 100% code coverage

* Typo
2018-10-05 17:39:10 +02:00
Matteo Collina
c26b4737c2
The serializer object should not have a prototype (#527) 2018-10-03 14:11:52 +02:00
Nathan Woltman
4b5db2756c Convert -Infinity to null (#520) 2018-09-24 23:57:47 +02:00
Matteo Collina
aa0bd756fa
Convert NaN and Infinity to null. (#519) 2018-09-24 17:33:08 +02:00
Matteo Collina
faacff3510
Do not override opts if the destination is a string (#513)
Fixes #512.
2018-09-03 14:33:29 +02:00
Nathan Woltman
c4fb9e1f27 Pass props from error objects to pino-pretty (#511) 2018-09-03 08:44:55 +02:00
Matteo Collina
8cc416bf99
Correctly assemble the message when errors are present (#501)
Fixes #500
2018-08-24 13:31:43 +02:00
Gyula Szalai
34692e97a0 Change pino.final docs and tests as requested 2018-08-21 16:00:16 +02:00
Gyula Szalai
fb54a088c2 Use const instead of var in tools.js 2018-08-21 14:25:28 +02:00
Gyula Szalai
b2f6500b23 Modify pino.final to handle calls without a handler 2018-08-21 12:53:34 +02:00
Matteo Collina
7509504ff5
Protect from hacks (#493)
* Do not use SonicBoom if stdout has been tampered. Refactoring.

* docs

* moar docs
2018-08-19 18:22:13 +02:00
Matteo Collina
dd1d42ad82
Do not use SonicBoom for stdout on Lambda (#489) 2018-08-17 12:39:55 +02:00
Matteo Collina
930b0a4cf7
Forward to pretty an error object passed as first arg (#486)
Fixes https://github.com/pinojs/pino-pretty/issues/23
Fixes https://github.com/pinojs/pino-pretty/issues/24
2018-08-14 11:41:59 +02:00
Matteo Collina
1f68f372b8
Fix prettyPrint child data (#485)
Fixes https://github.com/pinojs/pino/issues/484
2018-08-13 12:19:27 +02:00
Matteo Collina
90be486228
Do not crash on dateformat. (#476) 2018-08-08 16:52:27 +02:00
Matteo Collina
be1161f4fc
More fixes to pino-pretty, now it applies serializers as expected (#475) 2018-08-08 15:17:02 +02:00
Matteo Collina
2d729cbdd5 Support redaction in pretty print 2018-08-08 14:31:17 +02:00
Matteo Collina
49c1b8183d Support serializers in pretty 2018-08-08 14:31:17 +02:00
Matteo Collina
8206a3d3f2
Support automatic destination with string. (#472) 2018-08-07 09:09:41 +02:00
Matteo Collina
d5f1ceffc9
Removed safe option (#470)
* Removed safe option

* Moved stringify from pino.js to lib/tools.js
2018-08-06 14:44:11 +02:00
David Mark Clements
c20ce268e8
Merge pull request #469 from pinojs/update-from-master
Update from master
2018-08-05 19:11:16 +02:00
David Mark Clements
0df047fad1 inline asJson (#467)
* inline asJson

* stringify boolean and number
2018-08-05 17:31:29 +02:00
Matteo Collina
c67fd1a63f Merge branch 'master' into update-from-master 2018-08-05 13:08:49 +02:00
Matteo Collina
e7f9471a13 Improve performance of depth benchmark by 20% 2018-08-02 23:03:10 +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
e76946a801 100% coverage 2018-07-08 20:39:42 +02:00
davidmarkclements
3c21d18fba tests: test param lambdas, destructure t, switch to end always, tweaks 2018-06-15 17:53:15 +02:00
davidmarkclements
2f94995541 final syntax tweaks 2018-06-12 19:37:28 +02:00
davidmarkclements
8f87bf5447 reduce code and further optimize LOG 2018-06-12 16:51:25 +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
97d5986d50 optimally clean entry point 2018-06-11 20:46:39 +02:00
davidmarkclements
5b86be0bbf privatize undocumented but non-underscore prefixed methods 2018-06-11 17:53:08 +02:00
davidmarkclements
bf2fb1cded copy func no longer needed 2018-06-11 17:45:53 +02:00
davidmarkclements
94ae3f8f45 more syntax polish & remove unnecessary prototype logger methods 2018-06-11 17:45:03 +02:00
davidmarkclements
80cd6d092c mappings 2018-06-11 17:23:13 +02:00
davidmarkclements
d29fa7e482 no underscore prefixed properties, private state and methods using symbols 2018-06-11 17:00:43 +02:00
davidmarkclements
e6248537ab more functional style for setup 2018-06-08 13:19:33 +02:00
davidmarkclements
66647d6bfd reduce noise in entry point 2018-06-08 13:14:56 +02:00
James Sumners
896625df52
Skip writing log when prettifier says to (#407) 2018-05-01 19:15:49 -04:00