Open richterdennis opened 6 months ago
This would be a fun one to add. Once upon a time we had
https://github.com/pinojs/pino-inspector
But we don't have it anymore because it had little usage.
In the meantime I found out, that the transports are running inside node:worker_threads
. I think there is no way to use node:inspector
inspector.console
inside a worker thread. Maybe there is a solution with inspector.Session
, session.connectToMainThread()
and session.post('Something.fancy')
. It would be much more easier to provide a hook inside the main thread like the logMethod hook but way later where the log object is finalized.
I did this and it got the logs to appear in webstorm's remote debugger which I use to connect to node --inspect. I develop on a remote server, mainly because I don't want to run a ton of microservices locally. Setting up a remote debugger is a big staple in my dev environment.
pino({
...otherOptions,
hooks: {
logMethod(args, method) {
console.log(args)
method.apply(this, args)
},
},
})
I want to debug my code using
node --inspect
ornode --inspect-brk
, but there is not a zero log in the debugger console.I tried to write my own transport using
node:inspector
andinspector.console.log
or even a simple console.log. But nothing works.