From 092391130c9b3ffd8bc58dca213b245782973467 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 26 Oct 2007 15:50:27 +0000 Subject: [PATCH] Query Aufrufe loggen nun auch woher sie kommen --- SL/DBUtils.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 { -- 2.20.1