FroMage / ceylon-obr-test

0 stars 0 forks source link

tools: Injecting standard streams #62

Open tombentley opened 10 years ago

tombentley commented 10 years ago

Originally created at Fri, 01 Feb 2013 09:48:26 GMT in ceylon/ceylon-common#26:

The tools framework currently doesn't do anything special for the standard streams (stdout, stderr & stdin): If a tool wants to print to standard output or error it just uses System.out.println()/System.err.println(). I'm wondering if we should change this. If the top level tool was responsible for injecting the PrintStreams (and InputStream in the case of standard input) it would:

It would mean that tools would need to use the injected streams instead of reaching immediately for System.*.

The other way of looking at this is that tools "shouldn't" be reaching for raw streams at all, but should be using logging. In which case this becomes a question about whether it is the top level tool's job to configure logging, or the individual tools', or some combination.

quintesse commented 10 years ago

Originally commented at Fri, 01 Feb 2013 09:56:09 GMT:

To me personally logging should not be used for "proper output", ie useful output that is part of the software's operation. I say this because it's normally possible to affect logging output from outside of the program and I don't think we want that.

So I would just go with your first option. (if my opinion means anything hehe)