Distinct log/userLog in Dispatch (#1419)
This commit is contained in:
parent
3984fba973
commit
77a558e13a
|
@ -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 ($@);
|
||||
|
|
Loading…
Reference in New Issue