pino does not print to console if node run with --inspect-brk

Created on 12 Jan 2019  路  7Comments  路  Source: pinojs/pino

Hi guys,

thank you for your work.

I have an issue running pino with node --inspect-brk, option used to debug in visual studio code, it does not print to console

to reproduce

pino.js

const log = require('pino')()
log.info('message')
node --inspect-brk=37655 test/pino.js

pino version: 5.10.6 and 4.17.6
node version: 8.15.0

Most helpful comment

Use outputCapture in your launch configuration https://code.visualstudio.com/updates/v1_17#_viewing-output-from-direct-stdoutstderr-writes

All 7 comments

By console, you mean the console in VSCode?

You can use https://github.com/pinojs/pino-inspector with Node 10 in that case.

What do you think about this? Is a bad idea?
https://github.com/braceslab/synthetic-pino

I just want to output to console during development and use pino destinations in production

I'm missing to understand how/why pino-inspector does not get that job done. It's actually built for that purpose.

I must use node v. 8.x

That solution is suboptimal because it's likely to have some edge cases in compatibility, however it will work. I'll recommend to migrate to Node 10 asap anyway.

Use outputCapture in your launch configuration https://code.visualstudio.com/updates/v1_17#_viewing-output-from-direct-stdoutstderr-writes

Thanks @jsumners!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

afgallo picture afgallo  路  4Comments

P4sca1 picture P4sca1  路  4Comments

ptommasi picture ptommasi  路  3Comments

davidmarkclements picture davidmarkclements  路  6Comments

yoshuawuyts picture yoshuawuyts  路  5Comments