473
|
357 |
5 |
0 |
$self->{'debugobj'} ||= do {
if (my $profile = $ENV{'DBIC_TRACE_PROFILE'}) {
require DBIx::Class::Storage::Debug::PrettyPrint;
my @pp_args;
if ($profile =~ m[^\.?/]) {
require Config::Any;
my $cfg = &try(sub {
'Config::Any'->load_files({'files', [$profile], 'use_ext', 1});
}
, &catch(sub {
$_ =~ s/at \s+ .+ Storage\.pm \s line \s \d+ $//x;
$self->throw_exception("Failure processing \$ENV{DBIC_TRACE_PROFILE}: $_");
}
));
@pp_args = values %{$$cfg[0];};
}
else {
@pp_args = {'profile', $profile};
};
&try(sub {
'DBIx::Class::Storage::Debug::PrettyPrint'->new(@pp_args);
}
, &catch(sub {
$self->throw_exception($_);
}
));
}
else {
require DBIx::Class::Storage::Statistics;
'DBIx::Class::Storage::Statistics'->new;
}
}
|