summaryrefslogtreecommitdiffstats
path: root/lib/Log/Dispatch
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-11-26 13:47:25 -0500
committerdoy <doy@tozt.net>2008-11-26 13:47:25 -0500
commit57a2433dcdba7b7b92299eff0778f8a78bac2cb8 (patch)
tree45a19c9d5541bda58158e5fc9b5bbb29f74f230a /lib/Log/Dispatch
parent4b47a0bd8ce0a76922f681a29878bd90341115b9 (diff)
downloadlog-dispatch-channels-57a2433dcdba7b7b92299eff0778f8a78bac2cb8.tar.gz
log-dispatch-channels-57a2433dcdba7b7b92299eff0778f8a78bac2cb8.zip
don't try to forward messages to nonexistant channels
Diffstat (limited to 'lib/Log/Dispatch')
-rw-r--r--lib/Log/Dispatch/Channels.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Log/Dispatch/Channels.pm b/lib/Log/Dispatch/Channels.pm
index 2021710..aeb52b1 100644
--- a/lib/Log/Dispatch/Channels.pm
+++ b/lib/Log/Dispatch/Channels.pm
@@ -41,7 +41,12 @@ sub _forward_to_channels {
# just wants a boolean
my $ret = 0;
for my $channel (@channels) {
- $ret ||= $self->{channels}{$channel}->$method(@_);
+ if (exists $self->{channels}{$channel}) {
+ $ret ||= $self->{channels}{$channel}->$method(@_);
+ }
+ else {
+ carp "Channel $channel doesn't exist";
+ }
}
return $ret;
}