Give default value for $loglevel.
authorW. Trevor King <wking@drexel.edu>
Thu, 26 May 2011 11:33:52 +0000 (07:33 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 26 May 2011 11:33:52 +0000 (07:33 -0400)
This fixes the following warning:

  Use of uninitialized value $loglevel in lc at
  Crypt/Monkeysphere/Logger.pm line 91.

Crypt/Monkeysphere/Logger.pm

index 4dc0874a0caed9c11d8eab19d7e221380d1570d1..28915970f0d4b56fdc70c531550a057f5c3ce3e1 100644 (file)
@@ -88,6 +88,9 @@
     my $class = shift;
     my $loglevel = shift;
 
+    $loglevel = 1
+      if (!defined $loglevel);
+
     my $self = {loglevel => $loglevels{lc($loglevel)}};
     $self->{loglevel} = $loglevels{error}
       if (!defined $self->{loglevel});