+ log_message(debug => @_);
+} #}}}
+
+my $log_open=0;
+sub log_message ($$) { #{{{
+ my $type=shift;
+
+ if ($config{syslog}) {
+ require Sys::Syslog;
+ unless ($log_open) {
+ Sys::Syslog::setlogsock('unix');
+ Sys::Syslog::openlog('ikiwiki', '', 'user');
+ $log_open=1;
+ }
+ eval {
+ Sys::Syslog::syslog($type, join(" ", @_));
+ }
+ }
+ elsif (! $config{cgi}) {