We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsure if this is purposeful, but I ran into this small issue while replacing some of my existing warning logs.
Test file:
$ cat test.mjs import pino from 'pino' const log = pino() Promise.reject("FAIL").catch(log.error);
Pino Exception:
/tmp/pino/node_modules/pino/lib/tools.js:68 if (typeof this[msgPrefixSym] === 'string' && msg !== undefined && msg !== null) { ^ TypeError: Cannot read properties of undefined (reading 'Symbol(pino.msgPrefix)') at LOG (/tmp/pino/node_modules/pino/lib/tools.js:68:22)
To get it working, you must bind the correct context:
$ cat test.mjs import pino from 'pino' const log = pino() Promise.reject("FAIL").catch(log.error.bind(log)); // OR Promise.reject("FAIL").catch(e => log.error(e));
Expected result: pino should just log the error without throwing an exception. Thanks
The text was updated successfully, but these errors were encountered:
This is expected. Back in the days, .bind() was very expensive, so we avoided it. We would need to check if it's still the case.
Sorry, something went wrong.
No branches or pull requests
Unsure if this is purposeful, but I ran into this small issue while replacing some of my existing warning logs.
Test file:
Pino Exception:
To get it working, you must bind the correct context:
Expected result: pino should just log the error without throwing an exception. Thanks
The text was updated successfully, but these errors were encountered: