in reply to How to detect I/O redirection on Win32

You should not be printing errors and warnings to both channels in the first place.

By doing so, you are preventing the user from ignoring them, and that is presumptive.

Only write errors and warnings to STDERR and allow the user to decide whether they wish to redirect them or ignore them, and then your question becomes moot or mute or irrelevant.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: How to detect I/O redirection on Win32

Replies are listed 'Best First'.
Re^2: How to detect I/O redirection on Win32
by Anonymous Monk on Sep 11, 2007 at 07:28 UTC
    Hi,

    the PERL scripts are part of a software release process (CM) and I definitely DON'T WANT the users to ignore errors or warnings.

    The log file is parsed later and transformed into HTML where warnings and errors get colored....

    If the whole subprocess is redirected I need to print out errors/warnings ONCE and if it is not I have to print both to STDERR and STDOUT and eventually to a LOGFILE handle...

    And as long as the "master" process is NOT controlled by a PERL script, but some BATchfile I cannot control redirection /logging to the log file.

        Hey, this is not a discussion on user psychology!!

        If a software release PRODUCES warnings and/or errors IT HAS to be logged. The users can decide to ignore the warnings, but the process won't let pass software with (MAKE/compile) errors. So the process has to take care to "see" as much as possible of the making, compiling, packaging ...

        To *release* a software to test department WITH build errors is just a waste of time!