summaryrefslogtreecommitdiff
path: root/Echolot/Pinger/Mix.pm
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2003-01-14 05:25:35 +0000
committerPeter Palfrader <peter@palfrader.org>2003-01-14 05:25:35 +0000
commitf46e990efedb3d5d8ef94e833e0fa676047da1fe (patch)
tree2482570e7e1c1b8458f3cf89163b87a30d1b1b70 /Echolot/Pinger/Mix.pm
parente612f292dab8caad8f62cfef0ac40ae930d8efdf (diff)
First go at sane logging
Diffstat (limited to 'Echolot/Pinger/Mix.pm')
-rw-r--r--Echolot/Pinger/Mix.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/Echolot/Pinger/Mix.pm b/Echolot/Pinger/Mix.pm
index 40d2d9b..7bca883 100644
--- a/Echolot/Pinger/Mix.pm
+++ b/Echolot/Pinger/Mix.pm
@@ -1,7 +1,7 @@
package Echolot::Pinger::Mix;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Mix.pm,v 1.9 2002/09/10 20:03:20 weasel Exp $
+# $Id: Mix.pm,v 1.10 2003/01/14 05:25:35 weasel Exp $
#
=pod
@@ -17,8 +17,8 @@ This package provides functions for sending mixmaster (type II) pings.
=cut
use strict;
-use Carp qw{cluck};
use English;
+use Echolot::Log;
sub ping($$$$) {
my ($body, $to, $chain, $keys) = @_;
@@ -27,25 +27,25 @@ sub ping($$$$) {
my $keyring = Echolot::Config::get()->{'mixhome'}.'/pubring.mix';
open (F, '>'.$keyring) or
- cluck("Cannot open $keyring for writing: $!"),
+ Echolot::Log::warn("Cannot open $keyring for writing: $!."),
return 0;
for my $keyid (keys %$keys) {
print (F $keys->{$keyid}->{'summary'}, "\n\n");
print (F $keys->{$keyid}->{'key'},"\n\n");
};
close (F) or
- cluck("Cannot close $keyring: $!"),
+ Echolot::Log::warn("Cannot close $keyring: $!."),
return 0;
my $type2list = Echolot::Config::get()->{'mixhome'}.'/type2.list';
open (F, '>'.$type2list) or
- cluck("Cannot open $type2list for writing: $!"),
+ Echolot::Log::warn("Cannot open $type2list for writing: $!."),
return 0;
for my $keyid (keys %$keys) {
print (F $keys->{$keyid}->{'summary'}, "\n");
};
close (F) or
- cluck("Cannot close $type2list: $!"),
+ Echolot::Log::warn("Cannot close $type2list: $!."),
return 0;
my $mixcfg = Echolot::Config::get()->{'mixhome'}.'/mix.cfg';
@@ -53,7 +53,7 @@ sub ping($$$$) {
Echolot::Config::get()->{'my_domain'};
my $sendmail = Echolot::Config::get()->{'sendmail'};
open (F, ">$mixcfg") or
- cluck("Cannot open $mixcfg for writing: $!"),
+ Echolot::Log::warn("Cannot open $mixcfg for writing: $!."),
return 0;
print (F "REMAIL n\n");
print (F "NAME Echolot Pinger\n");
@@ -62,12 +62,12 @@ sub ping($$$$) {
print (F "TYPE2LIST type2.list\n");
print (F "SENDMAIL $sendmail -f $address -t\n");
close (F) or
- cluck("Cannot close $mixcfg: $!"),
+ Echolot::Log::warn("Cannot close $mixcfg: $!."),
return 0;
$ENV{'MIXPATH'} = Echolot::Config::get()->{'mixhome'};
open(MIX, "|".Echolot::Config::get()->{'mixmaster'}." -m -S -l $chaincomma") or
- cluck("Cannot exec mixpinger: $!"),
+ Echolot::Log::warn("Cannot exec mixpinger: $!."),
return 0;
print MIX "To: $to\n\n$body\n";
close (MIX);