Skip to content

redirect diagnostic output / logging to stderr#48

Open
cwbriones wants to merge 1 commit into
KoskiLabs:masterfrom
cwbriones:stderr_all_the_things
Open

redirect diagnostic output / logging to stderr#48
cwbriones wants to merge 1 commit into
KoskiLabs:masterfrom
cwbriones:stderr_all_the_things

Conversation

@cwbriones

@cwbriones cwbriones commented Jul 15, 2020

Copy link
Copy Markdown

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
Copy Markdown
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