From 3f1a7d80058c501bce43c8a4a6c6d2f4f530ab0d Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 9 Jan 2006 20:46:47 +0000 Subject: [PATCH] fix a few Log/Dbg thingies. remove all references to QXProt.pm --- perl/DXCommandmode.pm | 20 +++++++------------- perl/DXUser.pm | 9 ++++----- perl/cluster.pl | 11 ++++------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 89efeb4b..404a7391 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -93,7 +93,7 @@ sub start my $host = $self->{conn}->{peerhost}; $host ||= "AGW Port #$self->{conn}->{agwport}" if exists $self->{conn}->{agwport}; $host ||= "unknown"; - Log('DXCommand', "$call connected from $host"); + LogDbg('DXCommand', "$call connected from $host"); $self->{name} = $name ? $name : $call; $self->send($self->msg('l2',$self->{name})); @@ -562,7 +562,7 @@ sub disconnect # send info to all logged in thingies $self->tell_login('logoutu'); - Log('DXCommand', "$call disconnected"); + LogDbg('DXCommand', "$call disconnected"); $self->SUPER::disconnect; } @@ -1026,8 +1026,7 @@ sub import_cmd # are there any to do in this directory? return unless -d $cmdimportdir; unless (opendir(DIR, $cmdimportdir)) { - dbg("can\'t open $cmdimportdir $!"); - Log('err', "can\'t open $cmdimportdir $!"); + LogDbg('err', "can\'t open $cmdimportdir $!"); return; } @@ -1039,9 +1038,7 @@ sub import_cmd my $s = Script->new($name, $cmdimportdir); if ($s) { - - dbg("Run import cmd file $name"); - Log('DXCommand', "Run import cmd file $name"); + LogDbg('DXCommand', "Run import cmd file $name"); my @cat = split /[^A-Za-z0-9]+/, $name; my ($call) = grep {is_callsign(uc $_)} @cat; $call ||= $main::mycall; @@ -1072,19 +1069,16 @@ sub import_cmd $dxchan->{priv} = $priv; $dxchan->{user} = $user; } else { - Log('err', "Trying to run import cmd for non-existant user $call"); - dbg( "Trying to run import cmd for non-existant user $call"); + LogDbg('err', "Trying to run import cmd for non-existant user $call"); } } } $s->erase; for (@out) { - Log('DXCommand', "Import cmd $name/$call: $_"); - dbg("Import cmd $name/$call: $_"); + LogDbg('DXCommand', "Import cmd $name/$call: $_"); } } else { - Log("Failed to open $cmdimportdir/$name $!"); - dbg("Failed to open $cmdimportdir/$name $!"); + LogDbg('err', "Failed to open $cmdimportdir/$name $!"); unlink "$cmdimportdir/$name"; } } diff --git a/perl/DXUser.pm b/perl/DXUser.pm index adddce0a..6e2c014e 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -344,8 +344,7 @@ sub asc_decode my $ref; eval '$ref = ' . $s; if ($@) { - dbg($@); - Log('err', $@); + LogDbg('err', $@); $ref = undef; } return $ref; @@ -492,7 +491,7 @@ print "There are $count user records and $err errors\n"; my $ekey = $key; $eval =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; $ekey =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; - Log('DXCommand', "Export Error1: $ekey\t$eval"); + LogDbg('DXCommand', "Export Error1: $ekey\t$eval"); eval {$dbm->del($key)}; dbg(carp("Export Error1: $ekey\t$eval\n$@")) if $@; ++$err; @@ -505,7 +504,7 @@ print "There are $count user records and $err errors\n"; unless ($ref->{lat} && $ref->{long} || $ref->{qth} || $ref->{qra}) { eval {$dbm->del($key)}; dbg(carp("Export Error2: $key\t$val\n$@")) if $@; - Log('DXCommand', "$ref->{call} deleted, too old"); + LogDbg('DXCommand', "$ref->{call} deleted, too old"); $del++; next; } @@ -514,7 +513,7 @@ print "There are $count user records and $err errors\n"; print $fh "$key\t" . $ref->asc_encode . "\n"; ++$count; } else { - Log('DXCommand', "Export Error3: $key\t$val"); + LogDbg('DXCommand', "Export Error3: $key\t$val"); eval {$dbm->del($key)}; dbg(carp("Export Error3: $key\t$val\n$@")) if $@; ++$err; diff --git a/perl/cluster.pl b/perl/cluster.pl index 5d5a824a..80c4a057 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -182,8 +182,7 @@ sub new_channel if ($bumpexisting) { my $ip = $conn->{peerhost} || 'unknown'; $dxchan->send_now('D', DXM::msg($lang, 'conbump', $call, $ip)); - Log('DXCommand', "$call bumped off by $ip, disconnected"); - dbg("$call bumped off by $ip, disconnected"); + LogDbg('DXCommand', "$call bumped off by $ip, disconnected"); $dxchan->disconnect; } else { already_conn($conn, $call, DXM::msg($lang, 'conother', $call, $main::mycall)); @@ -199,7 +198,7 @@ sub new_channel if ($baseuser && $baseuser->lockout || $lock) { if (!$user || !defined $lock || $lock) { my $host = $conn->{peerhost} || "unknown"; - Log('DXCommand', "$call on $host is locked out, disconnected"); + LogDbg('DXCommand', "$call on $host is locked out, disconnected"); $conn->disconnect; return; } @@ -284,8 +283,7 @@ sub cease $l->close_server; } - dbg("DXSpider version $version, build $build ended") if isdbg('chan'); - Log('cluster', "DXSpider V$version, build $build ended"); + LogDbg('cluster', "DXSpider V$version, build $build ended"); dbgclose(); Logclose(); @@ -351,13 +349,12 @@ STDOUT->autoflush(1); $build += $main::version; $build = "$build.$branch" if $branch; -Log('cluster', "DXSpider V$version, build $build started"); +LogDbg('cluster', "DXSpider V$version, build $build started"); # banner my ($year) = (gmtime)[5]; $year += 1900; dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH"); -dbg("DXSpider Version $version, build $build started"); # try to load the database if ($dsn && -e "$root/perl/DXSql.pm") { -- 2.43.0