I got stuck on this one, and this time I will not continue banging my had against the wall before I open this thread.
here is my deal: tar write to stdout, pipe to a CMD for post processing, redirect the verbose output of tar to tar.log and stderr to tar_err.log while not touching stdout or stderr of the CMD of the post proc.
I know this is because of buffering of stdout but when can i expect output of stdout in the following proggram. If i run, I am always getting "stderr" as output. If i add '\n' or fflush(stdout) then only i am getting both statements. If i don't add '\n' or fflush(stdout),i am not getting "stdout" as output.
Usually log messages are written to stderr. I'm wondering if it is a good idea/practice to split log messages so that errors and warnings go to stderr while debug/informational/notice messages go to stdout instead?