-
Notifications
You must be signed in to change notification settings - Fork 110
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
LogOutputStream.create(LineConsumer) #107
LogOutputStream.create(LineConsumer) #107
Conversation
If we are going to proceed with this, then I can also add an example to the readme file. |
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.
Cool idea, thanks! I think the JavaDoc could be better (I added some comments with suggestions, feel free to use those as inspiration).
Also, a unit test and example usage in README would be much appreciated.
src/main/java/org/zeroturnaround/exec/stream/LogOutputStream.java
Outdated
Show resolved
Hide resolved
src/main/java/org/zeroturnaround/exec/stream/LogOutputStream.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Neeme Praks <neeme.praks@eesti.ee>
Co-authored-by: Neeme Praks <neeme.praks@eesti.ee>
README.md
Outdated
|
||
```java | ||
new ProcessExecutor().command("java", "-version") | ||
.redirectOutput(LogOutputStream.create(line -> ...)) |
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.
Theoretically, there could be also a new method here .processOutput(line -> ...)
, WDYT?
Bytecode compatibility is set to Java 6 as a minimum which will prevent the use of lambdas. Bear in mind that bumping Java baseline constitutes a breaking change and thus the library should increase its major version number according to semver. |
The lambdas will be not here, but in code using this library. |
@nemecec Could you lease take a look? Thanks! |
Is this project maintained? |
Sorry, I totally forgot about this PR. Looks good, I'll merge it in. |
Thanks for the PR! |
So instead of creating an anonymous class it can be one-liner with lambda expression.