From: Sven Schöling Date: Fri, 26 Oct 2007 15:50:27 +0000 (+0000) Subject: Query Aufrufe loggen nun auch woher sie kommen X-Git-Tag: release-2.6.0beta1~457 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=092391130c9b3ffd8bc58dca213b245782973467;p=kivitendo-erp.git Query Aufrufe loggen nun auch woher sie kommen --- diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index da38640c9..46fe23fa4 100644 --- a/SL/DBUtils.pm +++ b/SL/DBUtils.pm @@ -67,6 +67,12 @@ sub do_statement { sub dump_query { my ($level, $msg, $query) = splice(@_, 0, 3); + my $filename = $self_filename = 'SL/DBUtils.pm'; + my $caller_level; + while ($filename eq $self_filename) { + (undef, $filename, $line, $subroutine) = caller $caller_level++; + } + while ($query =~ /\?/) { my $value = shift(@_); $value =~ s/\'/\\\'/g; @@ -78,7 +84,9 @@ sub dump_query { $msg .= " " if ($msg); - $main::lxdebug->message($level, $msg . $query); + my $info = "$subroutine called from $filename:$line\n"; + + $main::lxdebug->message($level, $info . $msg . $query); } sub quote_db_date {