Skip to content

Conversation

danilobatistaqueiroz
Copy link

@danilobatistaqueiroz danilobatistaqueiroz commented Sep 18, 2023

Using src:true isn't work in new Node versions.

const log = bunyan.createLogger({
  name: "test",
  src: true,
});

Fixes: #714

As of Node 20.1.0 if you don't call new Error() the method prepareStackTrace isn't called.

Nodejs issue: nodejs/node#49681

Before the correction, using a Node version starting from 20.1.0, log.info returns an empty src.

//index.js
const bunyan = require("bunyan");
const log = bunyan.createLogger({name: "test", src: true});
log.info("test");
$ nvm use 18
$ node index.js

$ nvm use 20.5.0
$ node index.js

TESTS

There is a test for src named: src.test.js and using node version 20.1.0 or latter it breaks at line 45.

@ide
Copy link

ide commented Nov 17, 2023

Hi @trentm - would it be possible to get this reviewed and published?

@trentm
Copy link
Owner

trentm commented Nov 18, 2023

Looking.

@kaushals-deck
Copy link

Hi @trentm any update on the same...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bunyan fails to log 'src' when running in Node 20 versus Node 18
4 participants