[Pkg-privacy-commits] [msva-perl] 90/356: apply MSVA_LOG_LEVEL to Net::Server logging messages as well, so that verbosity is controlled with one variable
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository msva-perl.
commit 283910be78a1e2edf915fd830eb0b2d6a996b6eb
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Thu Mar 11 23:16:53 2010 -0500
apply MSVA_LOG_LEVEL to Net::Server logging messages as well, so that verbosity is controlled with one variable
---
msva-perl | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/msva-perl b/msva-perl
index 2a8b36d..0485dac 100755
--- a/msva-perl
+++ b/msva-perl
@@ -46,17 +46,19 @@ use strict;
},
);
+# Net::Server log_level goes from 0 to 4
+# this is scaled to match.
my %loglevels = (
- 'silent' => 1,
- 'quiet' => 2,
- 'fatal' => 3,
- 'error' => 4,
- 'info' => 5,
- 'verbose' => 6,
- 'debug' => 7,
- 'debug1' => 7,
- 'debug2' => 8,
- 'debug3' => 9,
+ 'silent' => 0,
+ 'quiet' => 0.25,
+ 'fatal' => 0.5,
+ 'error' => 1,
+ 'info' => 2,
+ 'verbose' => 3,
+ 'debug' => 4,
+ 'debug1' => 4,
+ 'debug2' => 5,
+ 'debug3' => 6,
);
my $rsa_decoder = Convert::ASN1->new;
@@ -79,6 +81,12 @@ use strict;
}
};
+ sub get_log_level {
+ my $level = $loglevels{lc($ENV{MSVA_LOG_LEVEL})};
+ $level = $loglevels{info} if (! defined $level);
+ return $level;
+ }
+
sub net_server {
return 'Net::Server::MSVA';
};
@@ -425,7 +433,7 @@ use strict;
push @args, untaint($_);
}
$ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET} = sprintf('http://localhost:%d', $self->port);
- exec(@args) or die;
+ exec(@args) or exit 111;
}
}
};
@@ -441,7 +449,10 @@ use strict;
}
my $server = MSVA->new();
-$server->run(host=>'localhost', msva=>$server);
+$server->run(host=>'localhost',
+ log_level=>MSVA::get_log_level(),
+ user => $>, # explicitly choose regular user (avoids a warning)
+ msva=>$server);
__END__
=head1 NAME
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git
More information about the Pkg-privacy-commits
mailing list