You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Peter Becker <pb...@meganesia.int.gu.edu.au> on 2001/06/12 15:07:06 UTC

OT: stdout vs. stderr (was: Having a problem)

Stephane Hillion wrote:
[...]
> A way to have some feedback from the JSVGCanvas is to set your own
> SVGUserAgent. For example:
> 
>     svgCanvas = new JSVGCanvas(new SVGUserAgent() {
>         public void displayError(String message) {
>             System.out.println(message);
>         }
[...]
> 
> Every error will be displayed using the standard output.

Errors should go to stderr, i.e. you should use System.err instead of
System.out. This might get important if someone wants to embed a program
in a script -- it can be quite nasty if you are not able to distinguish
between ordinary messages and real errors, e.g. you can't send mail like
"Program X produced error messages" with only the errors, not all the
other output.

Probably you don't want to build scripts around GUI programs but you
never know -- e.g. I usually pipe all the Mozilla output into different
files. The System.err output should be visible on each system, so you
shouldn't get any problems with this approach but you make the Unix
people happy ;-)

HTH,
   PeterB

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: OT: stdout vs. stderr (was: Having a problem)

Posted by Vincent Hardy <vi...@sun.com>.
Peter,

I have entered a bug in Bugzilla (2157) to make sure we use stderr
and not stdout for error messages.
Thanks!
Vincent.

Peter Becker wrote:
> 
> Stephane Hillion wrote:
> [...]
> > A way to have some feedback from the JSVGCanvas is to set your own
> > SVGUserAgent. For example:
> >
> >     svgCanvas = new JSVGCanvas(new SVGUserAgent() {
> >         public void displayError(String message) {
> >             System.out.println(message);
> >         }
> [...]
> >
> > Every error will be displayed using the standard output.
> 
> Errors should go to stderr, i.e. you should use System.err instead of
> System.out. This might get important if someone wants to embed a program
> in a script -- it can be quite nasty if you are not able to distinguish
> between ordinary messages and real errors, e.g. you can't send mail like
> "Program X produced error messages" with only the errors, not all the
> other output.
> 
> Probably you don't want to build scripts around GUI programs but you
> never know -- e.g. I usually pipe all the Mozilla output into different
> files. The System.err output should be visible on each system, so you
> shouldn't get any problems with this approach but you make the Unix
> people happy ;-)
> 
> HTH,
>    PeterB
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org