aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2018-11-24 21:13:20 +1300
committerDavid Phillips <david@yeah.nah.nz>2018-11-24 21:13:44 +1300
commit7f2403aa647e72d83ec00ac596dfbef778945ff0 (patch)
tree2710c98e2af0feee8172ba1cc4c9b0bd38ded2ae
parent47e5bdaa4017df0fdb3015b2da57c0a95c0a089b (diff)
downloadidalius-7f2403aa647e72d83ec00ac596dfbef778945ff0.tar.xz
Add option to reduce log noise
-rw-r--r--IdaliusConfig.pm2
-rw-r--r--bot.conf.example1
-rwxr-xr-xidalius.pl4
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 ]
diff --git a/idalius.pl b/idalius.pl
index 7e2e775..d19087d 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -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) {