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
In node.js (tested in 14 and 16), logs do not contain the msg property when the first parameter is undefined.
msg
undefined
The following code
const logger = require("pino")(); logger.info("hello world"); logger.info({ a: 1 }, "hello world"); logger.info(null, "hello world"); logger.info(undefined, "hello world"); const child = logger.child({ a: "im a child" }); child.info({ a: 1 }, "hello daddy"); child.info(null, "hello daddy"); child.info(undefined, "hello daddy");
logs the following content (hostname has been changed 😉 ):
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","msg":"hello world"} {"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":1,"msg":"hello world"} {"level":30,"time":1663063554791,"pid":43360,"hostname":"...","msg":"hello world"} {"level":30,"time":1663063554791,"pid":43360,"hostname":"..."} {"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child","a":1,"msg":"hello daddy"} {"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child","msg":"hello daddy"} {"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child"}
We can see the 4th log of both main logger and child logger does not have a msg property whereas it is ok when the first parameter is null.
null
However, it seems to be ok in the browser. Tested here : https://codesandbox.io/s/js-playground-forked-qsnm99?file=/src/index.js
The text was updated successfully, but these errors were encountered:
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Sorry, something went wrong.
fix(tools): log[level] compatible with when first argument is undefin…
b0e8d53
…ed (fix pinojs#1555)
e6d355c
…ed (fix #1555) (#1565)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Successfully merging a pull request may close this issue.
In node.js (tested in 14 and 16), logs do not contain the
msg
property when the first parameter isundefined
.The following code
logs the following content (hostname has been changed 😉 ):
We can see the 4th log of both main logger and child logger does not have a
msg
property whereas it is ok when the first parameter isnull
.However, it seems to be ok in the browser.
Tested here : https://codesandbox.io/s/js-playground-forked-qsnm99?file=/src/index.js
The text was updated successfully, but these errors were encountered: