aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm7
-rwxr-xr-xt/syslog.t2
2 files changed, 3 insertions, 6 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 97fe6b8ff..0f27ac419 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -843,12 +843,9 @@ sub log_message ($$) {
$log_open=1;
}
eval {
- # keep a copy to avoid editing the original config repeatedly
- my $wikiname = $config{wikiname};
- utf8::encode($wikiname);
- my $message = join(" ", @_);
+ my $message = "[$config{wikiname}] ".join(" ", @_);
utf8::encode($message);
- Sys::Syslog::syslog($type, "[$wikiname] %s", $message);
+ Sys::Syslog::syslog($type, "%s", $message);
};
if ($@) {
print STDERR "failed to syslog: $@" unless $log_failed;
diff --git a/t/syslog.t b/t/syslog.t
index d5c1bc56b..b9f366f19 100755
--- a/t/syslog.t
+++ b/t/syslog.t
@@ -11,7 +11,7 @@ $IkiWiki::config{syslog} = 1;
$IkiWiki::config{wikiname} = 'ASCII';
is(debug('test'), '', 'plain ASCII syslog');
-$IkiWiki::config{wikiname} = 'not ⒶSCII';
+$IkiWiki::config{wikiname} = 'not ⒶSCII and has %s in it';
is(debug('𝗧ĕṡҭ'), '', 'UTF8 syslog');
my $orig = $IkiWiki::config{wikiname};
is(debug('test'), '', 'check for idempotency');