Greetings M. Chu,
The most practical solution is to send running status messages to one
stream, as you suggest, though I would send it to stdout, not stderr. In
my view, stderr is for errors and diagnostics in the sense of debugging,
not for normal operation. A tool that reports the status of its
operations should send its output to stdout. Connection errors, timeouts
and such abnormal errors should be reported to stderr. Duplicate values,
existing values, entry not found and such are normal operational messages
and should be sent to stdout.
I made my changes because they were the simplest, fasted solutions which
do not modify the current tools default behavior. I also believe that in
the context of logging, using one single stream to record all events in
chronological order is very practical. Since we disagree on this matter
and you are chef architect of OpenLDAP, you decision stands and I respect
that. We will leave the tools as is.
Hallvard Breien Furuseth wrote:
> Hans Deragon wrote:
>> I implemented a simple common option (-K) for the client tools that
>> enabled, sets the file descriptor used to output errors to stdout
>> of the default (and currently used) stderr.
That would be stupid. Error messages belong on stderr, that's why it
>> This is done because when running a batch of commands with the output
>> to a file, logs collected are not shown chronologically because the
>> 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
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
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/