[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Added option (-K) on client tools to redirect errors on stdout instead of stderr.
Hallvard Breien Furuseth wrote:
Hans Deragon wrote:
I implemented a simple common option (-K) for the client tools that
if
enabled, sets the file descriptor used to output errors to stdout
instead
of the default (and currently used) stderr.
That would be stupid. Error messages belong on stderr, that's why it exists.
This is done because when running a batch of commands with the output
sent
to a file, logs collected are not shown chronologically because the
output
is split between stdout and stderr. (...)
There are two obvious fixes:
1) don't send batches of commands that ignore errors, so that the
processing immediately stops at the failed entry.
2) change the error message text to include the input line number where it
failed.
Also a possibility:
don't send running status messages to stdout, send them only to stderr.
Technically the only commandline tool that normally produces "output" is
ldapsearch. Everything else is "diagnostic" and belongs on stderr anyway.
I suggest instead a -B option to make stdout unbuffered or
linebuffered.
stdout is already linebuffered by default when directed to a tty.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/