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

How to distinguish which process the output stream line comes from #468

Open
LookRain opened this issue Mar 8, 2024 · 1 comment
Open

Comments

@LookRain
Copy link

LookRain commented Mar 8, 2024

I have a output stream looking like this, however it doesn't work reliably because some lines simply do not have a prefix.

const outputStream = {
  write: (data) => {
    if (['[SDK]', '[bundle]', '[dts]'].some((str) => data.includes(str))) {
      sdkStream.write(data);
    } else if (data.includes('[Demo App]')) {
      demoStream.write(data);
    }
  },
};

May I know if there's any way I can tell reliably which process a line is coming form? Many thanks!

@gustavohenke
Copy link
Member

Not really. What you have is the best way right now.

However, we can change the output stream to have the command object alongside the text.
This would be a breaking change though.

PRs welcome, should be an easy change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants