any method or somthing to pass logs to chrome inspector ?
This is actually a very interesting problem that I've never looked into. It will require a bit of research.
Have you got any pointers on how to achieve this?
If logs are sent the stdout (the default) they will show up in the devtools console.. if they're sent to file they they'll be in the file (etc)
i use fastify and it's use pino logger but console.log console.error /stdout stderr will be show on terminal not chrome inspector
I'm having a very difficult time understanding why you think it would be otherwise. Is the Chrome inspector supposed to intercept stdout?
I thought it was, maybe it only intercepts console.log - or maybe it's changed and doesn't at all
PR's welcome @mhf-ir but I'm not sure this is going to be high priority for us
Profiling and logging the node application is important and we have same interface for both of them all on chrome inspector ? why is not high priority. What's your interfaces for profiles and logging ? One thing rule them all :smile:
https://nodejs.org/en/docs/guides/debugging-getting-started/
Pino log to standard output directly. The question is how to intercept and redirect that so that it shows up in the DevTools. We would have to send that message via the inspector protocol.
I do not think that is currently an API that Node.js is exposing.
Looks like the referenced core PR was merged. Do we need to do anything here?
We will need to write pino-inspector now using the same mechanism pretty-print uses, should be straightforward
Any ETA on this?
when starting with the implementation of this, please keep in mind that Node.js supports a kill signal like kill -usr1 ${pid} to start the inspector on an existing process
Here it is: https://github.com/pinojs/pino-inspector.
Of course, there be dragons. Let me know what you think in the issues there.
Most helpful comment
We will need to write pino-inspector now using the same mechanism pretty-print uses, should be straightforward