Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The close() method is not invoked on "unpipe" when using logger.child() #223

Open
2013xile opened this issue May 18, 2024 · 0 comments
Open

Comments

@2013xile
Copy link

2013xile commented May 18, 2024

As the code shows

if (src === this.parent) {

It will detect if the source stream is the same as the origin upon the "unpipe" event.
However, when using logger.child(), the object is actually changed and the close() method would never be triggered.

https://github.com/winstonjs/winston/blob/debf4fad6a4ee4121904781dc83f8723be604fbe/lib/winston/logger.js#L47

Now I have to trigger the close() method manually.

  transport.once('unpipe', () => {
    transport.close();
  });

I wonder if it is an expected behavior. Thanks in advanced.

@2013xile 2013xile changed the title The close() method is not invoked on "unpipe" when use logger.child() The close() method is not invoked on "unpipe" when using logger.child() May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant