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

#734: Improve Process Result Model #773

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alfeilex
Copy link
Member

Fixes: #734

*/
public record LogEvent(boolean error, String message) {

}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be located in the process or log package or elsewhere?

CompletableFuture<List<String>> outFut = readInputStream(process.getInputStream());
CompletableFuture<List<String>> errFut = readInputStream(process.getErrorStream());
CompletableFuture<List<String>> outFut = readInputStream(process.getInputStream(), false, logs);
CompletableFuture<List<String>> errFut = readInputStream(process.getErrorStream(), true, logs);
out = outFut.get();
err = errFut.get();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove out and err and keep all the logs in a single list of LogEvent? If so, we will need to refactor ProcessResult as well, right?

synchronized (logs) {
LogEvent logEvent = new LogEvent(errorStream, line);
logs.add(logEvent);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, if I am using LogEvent correctly. In this implementation, a single LogEvent instance represents one line from either stout or sterr. I don't see another solution to capture the entire log while keeping the order of the log streams.

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

Successfully merging this pull request may close these issues.

Improve ProcessResult: get out and err in order
1 participant