Commit 77a558e1 authored by Xavier Guimard's avatar Xavier Guimard

Distinct log/userLog in Dispatch (#1419)

parent 3984fba9
......@@ -7,16 +7,17 @@ our $VERSION = '2.0.0';
sub new {
no warnings 'redefine';
my $self = bless {}, shift;
my ($conf) = @_;
my ($conf,%args) = @_;
my %bck;
my $last;
my $show = 1;
unless ( $conf->{logDispatchError} ) {
die 'At least, logDispatchError must be defined in conf';
my $root = $args{user} ? 'userLogDispatch' : 'logDispatch';
unless ( $conf->{$root.'Error'} ) {
die "At least, ${root}Error must be defined in conf";
}
foreach my $l (qw(error warn notice info debug)) {
if ($show) {
$last = $conf->{ "logDispatch" . ucfirst($l) } || $last;
$last = $conf->{ $root . ucfirst($l) } || $last;
unless ( $bck{$last} ) {
eval "require $last";
die $@ if ($@);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment