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

Proposal: logs (w/ follow option) provided as logstream method and resolves to {stdout,stderr,process} object #127

Open
jeremygiberson-at-privoro opened this issue Feb 11, 2021 · 2 comments

Comments

@jeremygiberson-at-privoro

Use case:
I'm implementing a wait-for-logs strategy to determine container readiness.
I could do polling and repeatedly call logs at some interval, but this is inefficient as I end up re-processing log lines.
I would prefer to add a stream data listener and check each log line as it output.

With the current implementation of logs (and the call to execCompose), it doesn't resolve until the process exits (which will be never for long running services like mysql).

I'd like to propose that instead of calling logs with an option to turn on follow and be given an un-resolving promise, we call a logstream method that resolves to an object containing {stdout, stderr, process}. This way we can attach listeners to the streams and potentially close the process when we're done w/ the logs.

Would a PR with this functionality be welcome?

@Steveb-p
Copy link
Contributor

@jeremygiberson-at-privoro This comes up now and then, see #33 and #80. PR will definitely be welcome.

@AlexZeitler
Copy link
Contributor

@jeremygiberson-at-privoro This would be very useful and the PR is much appreciated.

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

3 participants