pinojs / pino-socket

🌲 A transport for sending pino logs to network sockets
43 stars 14 forks source link

resolves #38 replace close option by destroy #75

Closed ggrossetie closed 2 years ago

ggrossetie commented 2 years ago

Not sure how to test but close is not a valid option: https://nodejs.org/api/stream.html#new-streamreadableoptions

resolves #38

ggrossetie commented 2 years ago

I don't know how to add a unit test without exporting the socket object (i.e., public accessor) to make sure that the socket was destroyed when the writable stream is closed.

Alternatively, I can add a new option onSocketDestroyed (callback function) called after socket.destroy?

Thoughts?

mcollina commented 2 years ago

Export the socket.

ggrossetie commented 2 years ago

Unit test added!