[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] question regarding stdio and streams
From: |
Ethan Blanton |
Subject: |
Re: [Monotone-devel] question regarding stdio and streams |
Date: |
Sat, 23 Dec 2006 08:52:26 -0500 |
User-agent: |
Mutt/1.5.12-2006-07-14 |
Nathaniel J. Smith spake unto us the following wisdom:
> On Wed, Dec 20, 2006 at 01:13:01PM -0500, Ethan Blanton wrote:
> > Thomas Keller spake unto us the following wisdom:
> > > Apparently informational messages (printed with the P() macro) and
> > > ticker output goes to clog instead of cout. If I want to move those
> > > output to the stdio output, which currently only processes cout, what
> > > would be the supposed way?
> >
> > It would generally be good to move these to stdout, anyway ... the
> > fact that ticker output goes to stderr is quite disconcerting for
> > those reared in the Unix Way -- who expect only errors to go to
> > stderr.
>
> However, this would break piping, which is a rather more important
> part of the Unix Way :-). In particular: diff, log, status, annotate,
> cat, all automate commands (and _especially_ automate stdio), ... all
> expect their stdout stream to pristine of random chatter.
Normally this is handled by:
if (!isatty(1))
do_not_print_random_junk()
The fact that ticker junk is leftover when piping is one very
important example of where I have found this irritating. Optionally,
tickers could be turned off without --verbose, instead. On a whole,
monotone is *extremely* verbose, which, again, is not part of the Unix
Way -- I find myself ignoring monotone's output, because it always
prints junk and the junk is never relevant. This is bad, because at
some point that junk will contain an error or a warning that I'll
really wish I'd seen. The boy who cried wolf effect is going on,
here.
> If you want to include the information into automate stdio's stdout
> stream, you need to multiplex it in somehow, and I don't have any
> particular opinion on what the best way would be to write such code.
> I'm sort of surprised you even want it :-).
Well, that must be directed at the thread in general, and not me,
because I'm not using automate stdio. ;-)
Ethan
--
The laws that forbid the carrying of arms are laws [that have no remedy
for evils]. They disarm only those who are neither inclined nor
determined to commit crimes.
-- Cesare Beccaria, "On Crimes and Punishments", 1764
signature.asc
Description: Digital signature