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

redirect diagnostic output / logging to stderr #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cwbriones
Copy link

@cwbriones cwbriones commented Jul 15, 2020

I want to have verbose logging enabled, but I still want to only capture the output of the wrapped command.

e.g.

$ out=$(JDKW_VERBOSE=1 ./jdk-wrapper.sh echo ok)
$ echo $out
ok

Expectation: The above prints ok

Observed: The above includes all of the logging from jdk-wrapper

I redirected the remaining logging commands that still printed to stdout.

@vjkoskela
Copy link
Member

As discussed, the goal of JDK Wrapper is to be transparent to the output of the command when verbose is false. The wrapper program may also write to stderr. So remapping the wrapper's verbose output to stderr doesn't really separate it from the program's output.

If we need to add this functionality, I'm guessing it would require to directing verbose/program output to separate destinations. Obvious candidates include a file, named pipe or socket (maybe a logging server). This would probably add a fair bit of complexity to the wrapper.

Can you elaborate on your use case that you need verbose output but separately from the command output?

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

Successfully merging this pull request may close these issues.

2 participants