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

Improve ProcessResult: get out and err in order #734

Open
hohwille opened this issue Nov 1, 2024 · 0 comments · May be fixed by #773
Open

Improve ProcessResult: get out and err in order #734

hohwille opened this issue Nov 1, 2024 · 0 comments · May be fixed by #773
Assignees
Labels
enhancement New feature or request

Comments

@hohwille
Copy link
Member

hohwille commented Nov 1, 2024

With #653 we now log the standard output and error messages of a process so the use can see it (e.g. in case of errors) even if it was captured.
However, this now opens a new problem:
We have modelled this as two independent Lists:

private final List<String> out;
private final List<String> err;

With this design it is impossible to print these messages in their original order how it was printed by the actual process.
Let us look at the following example:

#!/usr/bin/env bash

echo "out1"
echo "err1" >&2
sleep 5
echo "out2"
echo "err2" >&2

This program will let you see this on your console:

out1
err1
out2
err2

However, with IDEasy and DEFAULT_CAPTURE we would get:

out1
out2
err1
err2

The idea and expectation of this story is to change the model (e.g. having a single list of LogEvents) and the way we read the out and err from the thread to preserve the order (as far as possible).

NOTE: With Java Process API it is impossible to create a perfect solution as you can read here.

@hohwille hohwille added the enhancement New feature or request label Nov 1, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Nov 1, 2024
@alfeilex alfeilex self-assigned this Nov 5, 2024
@alfeilex alfeilex moved this from 🆕 New to 🏗 In progress in IDEasy board Nov 5, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Nov 19, 2024
@alfeilex alfeilex linked a pull request Nov 19, 2024 that will close this issue
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Nov 19, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Nov 19, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Nov 20, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Dec 10, 2024
…rocess-result

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/process/ProcessContextImpl.java
#	cli/src/main/java/com/devonfw/tools/ide/process/ProcessResultImpl.java
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Dec 10, 2024
jan-vcapgemini added a commit to alfeilex/IDEasy that referenced this issue Dec 12, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Dec 16, 2024
alfeilex added a commit to alfeilex/IDEasy that referenced this issue Dec 17, 2024
@hohwille hohwille added this to the release:2025.01.001 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

2 participants