stdout

David Relson relson at osagesoftware.com
Sat Sep 27 14:27:42 CEST 2003


On 27 Sep 2003 06:50:39 -0400
Tom Anderson <tanderso at oac-design.com> wrote:

> David,
> 
> > Bogofilter's normal output is to stdout.  Help, usage, and error
> > messages go to stderr.  Debug messages normally go to stderr, but
> > will be output to stdout if '-D' is used.  Under normal usage, the
> > debug messages don't appear.  They're activated by the '-x *'
> > options  (where'*' is any of several characters specifying which
> > debug output is wanted).
> >
> > What output are you seeing on stderr that you want on stdout?  It's
> > always possible that a print statement specifies the wrong
> > destination.
> 
> ---> bogofilter: list word - 733 spam, 35 good
> 
> This line is still on stderr even using -D.  Although I'm not exactly
> sure what that actually means, I assume it's something that could be
> useful to know.  Why is it on stderr?

Tom,

Why?  A mistake most likely.  

I've changed it from a trace statement using stderr to a debug statement
using dbgout.  So, a simple "-vv" won't cause it to print, but a "-x r
-vv" (which activates DEBUG_REGISTER statements) will print it.

> 
> > As to intermixing of stdout and stderr, that can be corrected using
> > fflush.  However, I'm unaware of any need for that.  You'll have to
> > enlighten me :->
> 
> ---> # 1483 words, 6 messages
> 
> This line used to get mixed into the middle of the word list, but
> setting $|=1 fixed that.
> 
> ---> X-Bogosity: Yes, tests=bogofilter, spamicity=1.000000,
> version=0.15.0
> 
> This line still appears multiple times throughout the word list,
> seemingly randomly.
> 
> BTW, I'm calling bogofilter as follows:
> bogofilter -Ns -vvv -D < spamfile 2>errfile1
> bogofilter -Sn -vvv -D < goodfile 2>errfile2

Why are you using "-vvv" when correcting registration errors?  FYI, the
normal (and proper) usage is just "-v".

Actually, you've uncovered a defect in bogofilter's option handling. 
When any of the registration options ('-n', '-N', '-s', and '-S') are
used, bogofilter is supposed to simply register the message not score it
(as the "X-Bogosity..." line indicates it's doing).  I'll take a look
and see what's needed to fix this.

The "-vv" and "-vvv" option are used to generate additional information
on bogofilter's operation.  As mentionned above, normal usage is to use
just "-v".  There's more info on "-vv" and "-vvv" in the FAQ.

> As I said, redirecting stderr to stdout (2>&1) tends to make the
> stderr line appear in the middle of the stdout word list.  Sending it
> to a file first is the only way I've been able to keep it seperate.
> 
> Tom
> 

Hope this helps.

David

-- 
David Relson                   Osage Software Systems, Inc.
relson at osagesoftware.com       Ann Arbor, MI 48103
www.osagesoftware.com          tel:  734.821.8800




More information about the Bogofilter mailing list