]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Merge remote-tracking branch 'bremner/master'
[ikiwiki.git] / IkiWiki.pm
index eb480969bd6fc0b72565a09fbb607a97fb94d52d..e5da04a3bb86d8aa47d96cac3df679623ad707ee 100644 (file)
@@ -743,6 +743,7 @@ sub debug ($) {
 }
 
 my $log_open=0;
+my $log_failed=0;
 sub log_message ($$) {
        my $type=shift;
 
@@ -753,9 +754,18 @@ sub log_message ($$) {
                        Sys::Syslog::openlog('ikiwiki', '', 'user');
                        $log_open=1;
                }
-               return eval {
-                       Sys::Syslog::syslog($type, "[$config{wikiname}] %s", join(" ", @_));
+               eval {
+                       # keep a copy to avoid editing the original config repeatedly
+                       my $wikiname = $config{wikiname};
+                       utf8::encode($wikiname);
+                       Sys::Syslog::syslog($type, "[$wikiname] %s", join(" ", @_));
                };
+                if ($@) {
+                    print STDERR "failed to syslog: $@" unless $log_failed;
+                    $log_failed=1;
+                    print STDERR "@_\n";
+                }
+                return $@;
        }
        elsif (! $config{cgi}) {
                return print "@_\n";
@@ -1498,7 +1508,7 @@ sub preprocess ($$$;$$) {
                                        push @params, $val, '';
                                }
                        }
-                       if ($preprocessing{$page}++ > 3) {
+                       if ($preprocessing{$page}++ > 8) {
                                # Avoid loops of preprocessed pages preprocessing
                                # other pages that preprocess them, etc.
                                return "[[!$command <span class=\"error\">".