Revision 142f7c2c
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
sub error {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
$main::lxdebug->full_error_call_trace();
|
||
$main::lxdebug->show_backtrace();
|
||
|
||
my ($self, $msg) = @_;
|
||
if ($ENV{HTTP_USER_AGENT}) {
|
SL/LXDebug.pm | ||
---|---|---|
package LXDebug;
|
||
|
||
use constant NONE => 0;
|
||
use constant INFO => 1;
|
||
use constant DEBUG1 => 2;
|
||
use constant DEBUG2 => 4;
|
||
use constant QUERY => 8;
|
||
use constant TRACE => 16;
|
||
use constant CALL_TRACE_ON_ERROR => 32;
|
||
use constant ALL => 63;
|
||
use constant NONE => 0;
|
||
use constant INFO => 1;
|
||
use constant DEBUG1 => 2;
|
||
use constant DEBUG2 => 4;
|
||
use constant QUERY => 8;
|
||
use constant TRACE => 16;
|
||
use constant BACKTRACE_ON_ERROR => 32;
|
||
use constant ALL => 63;
|
||
|
||
use constant FILE_TARGET => 0;
|
||
use constant STDERR_TARGET => 1;
|
||
... | ... | |
return 1;
|
||
}
|
||
|
||
sub full_error_call_trace {
|
||
sub show_backtrace {
|
||
my ($self) = @_;
|
||
|
||
return 1 unless ($global_level & CALL_TRACE_ON_ERROR);
|
||
return 1 unless ($global_level & BACKTRACE_ON_ERROR);
|
||
|
||
$self->message(CALL_TRACE_ON_ERROR, "Starting full caller dump:");
|
||
$self->message(BACKTRACE_ON_ERROR, "Starting full caller dump:");
|
||
my $level = 0;
|
||
while (my ($dummy, $filename, $line, $subroutine) = caller $level) {
|
||
$self->message(CALL_TRACE_ON_ERROR, "${subroutine} from ${filename}:${line}");
|
||
$self->message(BACKTRACE_ON_ERROR, "${subroutine} from ${filename}:${line}");
|
||
$level++;
|
||
}
|
||
|
lx-erp.conf | ||
---|---|---|
# LXDebug::DEBUG2
|
||
# LXDebug::QUERY - SQL Queries
|
||
# LXDebug::TRACE - Tracing von Funktionsaufrufen
|
||
# LXDebug::CALL_TRACE_ON_ERROR - Vollst?ndiger Aufrufpfad, wenn $form->error() aufgerufen wird
|
||
# LXDebug::BACKTRACE_ON_ERROR - Vollst?ndiger Aufrufpfad, wenn $form->error() aufgerufen wird
|
||
# LXDebug::ALL - alle Debugausgaben
|
||
#
|
||
# Beipiel:
|
Auch abrufbar als: Unified diff
Leicht anderer Name -- es ist im Endeffekt ein stack backtrace, also soll er auch so benannt werden.