Bladeren bron

Warnings about missing Text::Iconv are suppressed by 'silent'

Christoph Berg 21 jaren geleden
bovenliggende
commit
319adba69c
3 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 1 0
      docs/Changelog
  2. 2 1
      modules/Pisg/HTMLGenerator.pm
  3. 6 3
      modules/Pisg/Parser/Logfile.pm

+ 1 - 0
docs/Changelog

@@ -1,6 +1,7 @@
 pisg (0.62) - ??
    Changes by Christoph Berg:
    * Update mIRC script for the mIRC6hack format.
+   * Warnings about missing Text::Iconv are suppressed by 'silent'.
 
 pisg (0.61) - Sat Oct, 30th 2004
    Changes by Christoph Berg:

+ 2 - 1
modules/Pisg/HTMLGenerator.pm

@@ -33,7 +33,8 @@ sub new
             # convert from template charset to our
             $self->{iconv} = Text::Iconv->new($lang_charset, $self->{cfg}->{charset});
         } else {
-            print STDERR "Text::Iconv is not available, skipping charset conversion for language templates\n";
+            print "Text::Iconv is not installed, skipping charset conversion of language templates\n"
+                unless ($self->{cfg}->{silent});
         }
     }
 

+ 6 - 3
modules/Pisg/Parser/Logfile.pm

@@ -30,7 +30,8 @@ sub new
     $self->{parser} = $self->_choose_format($self->{cfg}->{format});
 
     if($self->{cfg}->{logcharsetfallback} and not $self->{cfg}->{logcharset}) {
-        print STDERR "Warning: LogCharset undefined, assuming LogCharset = LogCharsetFallback.\n";
+        print "LogCharset undefined, assuming LogCharset = LogCharsetFallback\n"
+            unless ($self->{cfg}->{silent});
         $self->{cfg}->{logcharset} = $self->{cfg}->{logcharsetfallback};
     }
 
@@ -46,7 +47,8 @@ sub new
                 $self->{iconvfallback} = Text::Iconv->new($self->{cfg}->{logcharsetfallback}, $self->{cfg}->{charset});
             }
         } else {
-            print STDERR "Text::Iconv is not available, skipping charset conversion of logfiles\n";
+            print "Text::Iconv is not installed, skipping charset conversion of logfiles\n"
+                unless ($self->{cfg}->{silent});
         }
     }
 
@@ -275,7 +277,8 @@ sub _parse_file
             if($line2) {
                 $line = $line2;
             } else {
-                print STDERR "Charset conversion failed for '$line'\n";
+                print "Charset conversion failed for '$line'\n"
+                    unless ($self->{cfg}->{silent});
             }
         }