wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]*)\]\]/,
wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/,
verbose => 0,
+ syslog => 0,
wikiname => "wiki",
default_pageext => "mdwn",
cgi => 0,
print "Content-type: text/html\n\n";
print misctemplate("Error", "<p>Error: @_</p>");
}
- die @_;
+ log_message(error => @_);
+ exit(1);
} #}}}
sub debug ($) { #{{{
return unless $config{verbose};
- if (! $config{cgi}) {
+ 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}) {
print "@_\n";
}
else {
* Relicense the templates and basewiki under the 2-clause BSD license.
Since these can easily become part of other people's websites, they
should be under as permissive a license as possible.
+ * Add --syslog config option, to log to the syslog.
- -- Joey Hess <joeyh@debian.org> Wed, 16 Aug 2006 16:30:44 -0400
+ -- Joey Hess <joeyh@debian.org> Wed, 16 Aug 2006 17:07:35 -0400
ikiwiki (1.19) unstable; urgency=low
#timeformat => '%c',
# Locale to use. Must be a UTF-8 locale.
#locale => 'en_US.UTF-8',
+ # Logging settings:
+ verbose => 0,
+ syslog => 0,
# To add plugins, list them here.
#add_plugins => [qw{meta tag pagecount brokenlinks search smiley
Specify how to display the time or date. The format string is passed to the
strftime(3) function.
-* --verbose
+* --verbose, --no-verbose
Be vebose about what is being done.
+* --syslog, --no-syslog
+
+ Log to syslog.
+
* --w3mmode, --no-w3mmode
Enable [[w3mmode]], which allows w3m to use ikiwiki as a local CGI script,
"setup|s=s" => \$config{setup},
"wikiname=s" => \$config{wikiname},
"verbose|v!" => \$config{verbose},
+ "syslog!" => \$config{syslog},
"rebuild!" => \$config{rebuild},
"refresh!" => \$config{refresh},
"wrappers!" => \$config{wrappers},