-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
…om/alfeilex/IDEasy into devonfw#734-improve-process-result
*/ | ||
public record LogEvent(boolean error, String message) { | ||
|
||
} |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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.
Fixes: #734