[Pkg-privacy-commits] [msva-perl] 336/356: avoid spurious warnings about undefined log levels

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:42:11 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 ad89ca2de6840d2e633f59dc7295d0e3831137af
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Jun 2 03:54:00 2011 -0400

    avoid spurious warnings about undefined log levels
---
 Crypt/Monkeysphere/Logger.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Crypt/Monkeysphere/Logger.pm b/Crypt/Monkeysphere/Logger.pm
index 4dc0874..c72c2ec 100644
--- a/Crypt/Monkeysphere/Logger.pm
+++ b/Crypt/Monkeysphere/Logger.pm
@@ -45,6 +45,8 @@
     my $self = shift;
     my $msglevel = shift;
 
+    $msglevel = 'error'
+      if (! defined($msglevel));
     if ($loglevels{lc($msglevel)} <= $self->{loglevel}) {
       printf STDERR @_;
     }
@@ -88,7 +90,7 @@
     my $class = shift;
     my $loglevel = shift;
 
-    my $self = {loglevel => $loglevels{lc($loglevel)}};
+    my $self = {loglevel => $loglevels{defined($loglevel) ? lc($loglevel) : 'error'}};
     $self->{loglevel} = $loglevels{error}
       if (!defined $self->{loglevel});
 

-- 
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