summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Echolot/Log.pm4
-rw-r--r--Echolot/Tools.pm18
-rw-r--r--NEWS1
-rw-r--r--TODO8
-rw-r--r--doc/pingd.conf.pod2
5 files changed, 16 insertions, 17 deletions
diff --git a/Echolot/Log.pm b/Echolot/Log.pm
index e156a3a..94838fd 100644
--- a/Echolot/Log.pm
+++ b/Echolot/Log.pm
@@ -19,6 +19,7 @@ use Carp qw{};
#use Time::HiRes qw( gettimeofday );
my %LOGLEVELS = qw{
+ trace 8
debug 7
info 6
notice 5
@@ -88,6 +89,9 @@ sub log_message($$) {
$LOGFH->flush();
};
+sub trace($) {
+ log_message('trace', $_[0]);
+};
sub debug($) {
log_message('debug', $_[0]);
};
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm
index ed1a022..d5846d7 100644
--- a/Echolot/Tools.pm
+++ b/Echolot/Tools.pm
@@ -279,14 +279,14 @@ sub make_gpg_fds() {
sub readwrite_gpg($$$$$) {
my ($in, $inputfd, $stdoutfd, $stderrfd, $statusfd) = @_;
- Echolot::Log::debug("Entering readwrite_gpg.");
+ Echolot::Log::trace("Entering readwrite_gpg.");
local $INPUT_RECORD_SEPARATOR = undef;
my $sout = IO::Select->new();
my $sin = IO::Select->new();
my $offset = 0;
- Echolot::Log::debug("input is $inputfd; output is $stdoutfd; err is $stderrfd; status is ".(defined $statusfd ? $statusfd : 'undef').".");
+ Echolot::Log::trace("input is $inputfd; output is $stdoutfd; err is $stderrfd; status is ".(defined $statusfd ? $statusfd : 'undef').".");
$inputfd->blocking(0);
$stdoutfd->blocking(0);
@@ -301,15 +301,15 @@ sub readwrite_gpg($$$$$) {
my ($readyr, $readyw, $written);
while ($sout->count() > 0) {
- Echolot::Log::debug("select waiting for ".($sout->count())." fds.");
+ Echolot::Log::trace("select waiting for ".($sout->count())." fds.");
($readyr, $readyw, undef) = IO::Select::select($sout, $sin, undef, 42);
- Echolot::Log::debug("ready: write: ".(scalar @$readyw)."; read: ".(scalar @$readyr));
+ Echolot::Log::trace("ready: write: ".(scalar @$readyw)."; read: ".(scalar @$readyr));
for my $wfd (@$readyw) {
- Echolot::Log::debug("writing to $wfd.");
+ Echolot::Log::trace("writing to $wfd.");
$written = $wfd->syswrite($in, length($in) - $offset, $offset);
$offset += $written;
if ($offset == length($in)) {
- Echolot::Log::debug("writing to $wfd done.");
+ Echolot::Log::trace("writing to $wfd done.");
close $wfd;
$sin->remove($wfd);
$sin = undef;
@@ -320,12 +320,12 @@ sub readwrite_gpg($$$$$) {
for my $rfd (@$readyr) {
if ($rfd->eof) {
- Echolot::Log::debug("reading from $rfd done.");
+ Echolot::Log::trace("reading from $rfd done.");
$sout->remove($rfd);
close($rfd);
next;
}
- Echolot::Log::debug("reading from $rfd.");
+ Echolot::Log::trace("reading from $rfd.");
if ($rfd == $stdoutfd) {
$stdout .= <$rfd>;
next;
@@ -340,7 +340,7 @@ sub readwrite_gpg($$$$$) {
}
}
}
- Echolot::Log::debug("readwrite_gpg done.");
+ Echolot::Log::trace("readwrite_gpg done.");
return ($stdout, $stderr, $status);
};
diff --git a/NEWS b/NEWS
index 128c281..4a9b926 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Changes in version - 2004
* gpg interaction cleanup, move a lot of duplicated code to
Echolot::Tools.
* Filter out mixmaster outputs to stderr that are no problem.
+ * There's a TRACE loglevel now, which is even more noisy than DEBUG.
Changes in version 2.1.3 - 2004-04-20
* Improvements to pingd.conf(5) by Colin.
diff --git a/TODO b/TODO
index 1e41aa6..2670a14 100644
--- a/TODO
+++ b/TODO
@@ -8,15 +8,8 @@ Legend:
D Deferred
X Abandoned
- - remove the verbose debug output in readwrite_gpg.
- (maybe a trace loglevel)
-
- updated information with from lines
- don't send that many messages with From Headers
- - supress mixmaster output:
- Warning: The message has a From: line.
- Chain: rebleep
- - have a timeout on GPG calls
- optionally log messages wich raise problems
- close and open files instead of keeping all the files open
- make 'not a remailer' check not that strict
@@ -39,3 +32,4 @@ can be done later:
X have different stats philosophies (pessimist, optimist..)
X get rid of dependency on mix
X get rid of dependency on gnupg
+ X have a timeout on GPG calls (nonblocking IO should solve the problem)
diff --git a/doc/pingd.conf.pod b/doc/pingd.conf.pod
index 50c2a5b..aa1d7b3 100644
--- a/doc/pingd.conf.pod
+++ b/doc/pingd.conf.pod
@@ -630,7 +630,7 @@ File to write logs to. This file is reopened on SIGHUP.
=item B<loglevel>
Minimum severity of messages to include in log file. Possible values are
-B<debug>, B<info>, B<notice>, B<warning>, B<error>, B<critical>, B<alert>, and
+B<trace>, B<debug>, B<info>, B<notice>, B<warning>, B<error>, B<critical>, B<alert>, and
B<emergency>.
Default: 'loglevel' => 'info',