You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Steven Manross <st...@manross.net> on 2005/05/22 18:06:39 UTC

debug and STDERR

Is there any way that something like this could be inserted/changed into
the Mail::SpamAssassin module...  Or is this just something that I
should implement as there's no other need for it?

sub dbg {
  <snip>
  if (!defined($dbg->{foo}) {
    warn "debug: $msg\n";
  } else {
    push (@{$Mail::SpamAssassin::foobar},"debug: $msg");
  }
}

I don't have access to STDERR from the way I am calling SA (From
Exchange 2K Event Sink calling SA classes directly)...

Or I can't figure out how to do it...  This is how I have been trying...

open(STDERR,">C:\\foo.log);

(I end up getting a 0-length file, and yes, debug = 1)..

I find it odd that MS would not give my access to STDERR, but it looks
to be the case. :(

Steven

Re: debug and STDERR

Posted by Loren Wilton <lw...@earthlink.net>.
> I find it odd that MS would not give my access to STDERR, but it looks
> to be the case. :(

You do usually have have access to stderr on a Windows platform.  However,
it is entirely possible that it has been hijacked by whatever the process is
that is calling SA and doesn't end up where you think; OR, depending on how
SA is started, SA might be a "non console" process, and will have
stderr>NULL.

The first thing I'd consider trying would be starting whatever is
creating/calling SA with something like "2>logfile.txt" and see if you can
get logging that way.

If that doesn't work, and you can't freopen stderr to something else inside
SA, than some other trick will probably be necessary.

        Loren