log message along with object
Closed this issue · 3 comments
thewh1teagle commented
Hello!
I would like to log messages along with objects, similar to how console.log
works.
for instance
import pino from 'pino'
const logger = pino({
name: 'app',
level: 'debug',
transport: {
target: "pino-pretty",
options: {
colorize: true,
},
},
});
logger.info('New message', {content: 'hello world'})
Expected output:
New Message {content: 'hello world'}
Actual output:
New Message
bngarren commented
In this case, try passing the object as the first param and the message string second. This is the way pino's log methods are overloaded. If a string is first param, you cannot pass a mergingObject next.
jsumners commented
github-actions commented
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.