id0Sch / log4js-json-layout

provides a slim and easy to use json-layout for log4js-node
MIT License
17 stars 8 forks source link

Fix error formatting #12

Closed bencehornak closed 3 years ago

bencehornak commented 3 years ago

As @jmbldwn pointed out in #11, errors are not rendered correctly, due to some changes of a dependency.

This is also indicated by the failing test:

  1) log4js-json-layout should format stack traces:
     AssertionError: expected '{"startTime":"615 Ludlam Place, Nicholson, New Mexico, 5763","categoryName":"572efdaaa64be9dbc56369ae","level":"INFO","data":"{ inspect: [Function: inspect] }"}' to include '"data":"Error: Whoops!\\n    at Context.<anonymous>'
      at Context.<anonymous> (test/unit/lib/jsonLayout.js:68:19)
      at processImmediate (internal/timers.js:461:21)

A simple fix is that fixed the tests was simply returning the error object, instead of the {inspect() {...}} construct.

id0Sch commented 3 years ago

Hi :) Sorry, I was unavailable, I'm swamped at work and have little to no time to maintain this lib.

I really appreciate you guys taking the time to discuss and suggest a fix, @jmbldwn please let me know once you made sure this fixes your issue so I can merge and release a new version (feels like a patch IMO).

Thanks again!!

bencehornak commented 3 years ago

No worries @id0Sch, thanks for the lib!

Yes, it sounds like a patch version.

jmbldwn commented 3 years ago

I checked out this PR and can confirm the tests pass now, but I ended up working around this problem a few weeks ago so not easy for me to test whether it fixes my original issue.

On Apr 12, 2021, at 8:01 AM, Bence Hornák @.**@.>> wrote:

No worries @id0Schhttps://github.com/id0Sch, thanks for the lib!

Yes, it sounds like a patch version.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/id0Sch/log4js-json-layout/pull/12#issuecomment-817885521, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAGQ6Z5A47F7F4EWJGJJSODTIMDOFANCNFSM42Y6ENZQ.

id0Sch commented 3 years ago

published 2.2.3