ADD: added some debug logging

This commit is contained in:
Dominik Meyer 2023-12-26 16:55:41 +01:00
parent 7fb5b3df28
commit dde0e7ea9d
Signed by: byterazor
GPG Key ID: EABDA0FD5981BC97

View File

@ -37,7 +37,8 @@ sub createDSN
my $dsn = "DBI:MariaDB:database=" . $self->{database} . ";host=" . $self->{host} . ";port=" . $self->{port}; my $dsn = "DBI:MariaDB:database=" . $self->{database} . ";host=" . $self->{host} . ";port=" . $self->{port};
$self->{dsn} = $dsn; $self->{dsn} = $dsn;
$self->log(LOGDEBUG, "created DSN " . $self->{DSN});
} }
sub createQuery sub createQuery
@ -71,6 +72,7 @@ sub createQuery
$self->{sqlquery}=$query; $self->{sqlquery}=$query;
$self->log(LOGDEBUG, "created query " . $self->{sqlquery});
} }
sub prepareParams sub prepareParams
@ -104,6 +106,7 @@ sub parseConfig
for my $line (@config) for my $line (@config)
{ {
$self->log(LOGDEBUG, "config line " . $line);
my @value = split /:=/, $line; my @value = split /:=/, $line;
my $key = lc($value[0]); my $key = lc($value[0]);
@ -176,7 +179,7 @@ sub askDatabase
{ {
my $self = shift; my $self = shift;
my $recipient = shift; my $recipient = shift;
my $dbh = DBI::connect($self->{dsn}, $self->{user}, $self->{pass},{ RaiseError => 0, PrintError => 0 }); my $dbh = DBI::connect($self->{dsn}, $self->{user}, $self->{pass});
if ($dbh->err()) if ($dbh->err())
{ {