diff options
author | David Phillips <david@yeah.nah.nz> | 2018-11-24 21:13:20 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2018-11-24 21:13:44 +1300 |
commit | 7f2403aa647e72d83ec00ac596dfbef778945ff0 (patch) | |
tree | 2710c98e2af0feee8172ba1cc4c9b0bd38ded2ae | |
parent | 47e5bdaa4017df0fdb3015b2da57c0a95c0a089b (diff) | |
download | idalius-7f2403aa647e72d83ec00ac596dfbef778945ff0.tar.xz |
Add option to reduce log noise
-rw-r--r-- | IdaliusConfig.pm | 2 | ||||
-rw-r--r-- | bot.conf.example | 1 | ||||
-rwxr-xr-x | idalius.pl | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/IdaliusConfig.pm b/IdaliusConfig.pm index 03adb11..642d408 100644 --- a/IdaliusConfig.pm +++ b/IdaliusConfig.pm @@ -47,7 +47,7 @@ sub check_config my ($config) = @_; # Lists of mandatory config variables - my @scalars = qw/nick username ircname server port usessl sslcert sslkey user group prefix_nick prefix/; + my @scalars = qw/nick username ircname server port usessl sslcert sslkey user group prefix_nick prefix log_debug/; my @lists = qw/plugins channels ignore/; foreach my $name (@scalars) { diff --git a/bot.conf.example b/bot.conf.example index 34cbf45..143ad4c 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -14,6 +14,7 @@ user = nobody group = nobody prefix_nick = 1 prefix = % +log_debug = 0 [Plugin::Admin] admins = [ snargle!~kleg@glarg.example.com ] @@ -348,6 +348,10 @@ sub irc_delay_removed { sub _default { my ($event, $args) = @_[ARG0 .. $#_]; + + # exit early unless in debug mode + return unless $config->{_}->{log_debug}; + my @output = ( "$event: " ); for my $arg (@$args) { |