pinojs / community

🌲 data on the members of the pino community
MIT License
1 stars 4 forks source link

pino "command spawner" #3

Open jsumners opened 7 years ago

jsumners commented 7 years ago

See https://github.com/atis--/pino-spawn/issues/1

Basically, it would provide a stream for Pino to write to. This stream would be spawned or forked via child_process.

Maybe pino-root?

cc @pinojs/core

mcollina commented 7 years ago

I think this can be a very simple module that sets some defaults for child_process, meaning correctly passing around the file descriptors for it to work. Ideally, we should just pass around the main process stdout, and let let client die if the main dies.

I do not think it is pino-specific either, we can just have a quick & easy module that we maintain.

jsumners commented 7 years ago

That sounds reasonable.

jsumners commented 7 years ago

This is sort of what https://github.com/jsumners/pipeline-manifold does.

mcollina commented 7 years ago

@jsumners yes. But with a simpler API that can be used from within node.

I like pino-root.

jsumners commented 7 years ago

https://www.npmjs.com/package/spork

mcollina commented 7 years ago

that does not give us the simplicity I would like to have, IMHO it should be a one-liner with the pino creation.

jsumners commented 7 years ago

It sounds like you have a clear idea in mind. Do you want to implement it?

mcollina commented 7 years ago

@jsumners yes, I'll give it a go.

atis-- commented 7 years ago

In case you're interested, I've added a new feature to pino-spawn where it passes bunyan-like streams config to the child process via stringified functions (check the readme). The child will then eval() the functions (most likely require()ing external libs), and then do its thing as before.

This allows using existing bunyan transports with (almost) the same config.

jsumners commented 7 years ago

I don't know what I think about that.