kivitendo/SL/DBConnect.pm @ 549dfe12
22c02125 | Moritz Bunkus | package SL::DBConnect;
|
||
use strict;
|
||||
use DBI;
|
||||
sub connect {
|
||||
shift;
|
||||
d8ac0828 | Moritz Bunkus | # print STDERR "Starting full caller dump:\n";
|
||
# my $level = 0;
|
||||
# while (my ($dummy, $filename, $line, $subroutine) = caller $level) {
|
||||
# print STDERR " ${subroutine} from ${filename}:${line}\n";
|
||||
# $level++;
|
||||
# }
|
||||
22c02125 | Moritz Bunkus | return DBI->connect(@_) unless $::lx_office_conf{debug} && $::lx_office_conf{debug}->{dbix_log4perl};
|
||
require Log::Log4perl;
|
||||
require DBIx::Log4perl;
|
||||
97358b9b | Sven Schöling | my $filename = $::lxdebug->file;
|
||
22c02125 | Moritz Bunkus | my $config = $::lx_office_conf{debug}->{dbix_log4perl_config};
|
||
$config =~ s/LXDEBUGFILE/${filename}/g;
|
||||
Log::Log4perl->init(\$config);
|
||||
return DBIx::Log4perl->connect(@_);
|
||||
}
|
||||
f964437c | Moritz Bunkus | sub get_options {
|
||
my $self = shift;
|
||||
my $options = {
|
||||
pg_enable_utf8 => $::locale->is_utf8,
|
||||
@_
|
||||
};
|
||||
return $options;
|
||||
}
|
||||
22c02125 | Moritz Bunkus | 1;
|