stderr behaviour

rehan khan rehan.khan at dsl.pipex.com
Mon Jul 14 02:12:07 PDT 2008


Recently I came across what I thought was odd behaviour in Smart relating to the use of stderr. As I understand it stderr is used to output program error messages like exceptions and bugs usually to provide feedback for debugging. So the question is 'what is a program error in the context of Smart?'. For example 'smart check' outputs to stderr. Now although the output of this command is reporting errors it is not reporting an error with Smart itself but an error with the metadata (which is external and actually unrelated to smart). Should this not just be output to stdout? This would make scripting smart less of a hassle.

The same issue occurs with the various --dump commands. From a users perspective the --dump commands tells them what might happen if they executed a certain command. Again this is to check the behaviour of the metadata not smart itself. although in this case the --dump commands can also be used to check the behaviour of the depsolver. So from a developer perspective outputting to stderr is right and from a users perspective outputting to stdout would be right (more expected than 'right'). I would guess that the --dump command originated from a debugging need but it is also quite useful for users so perhaps the output behaviour should change.

Personally I would expect tracebacks and the output of --log-level=DEBUG to go to stderr and any 'user' commands to go to stdout. What does the list think about this normalisation of expected behaviour?

It is quite useful for there to be a demarcation between 'user' and 'developer' features.  This is especially useful when it comes to documentation (the user manual and the developer manual) and user expectations. For an application of Smart's type I don't think every user should be expected to have development skills. Are there any other commands that fall into this grey area?

These are open questions and feedback from the list would be really useful.

Thanks
Rehan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20080714/2a76c6c8/attachment-0002.htm>


More information about the Smart mailing list