Revision 142f7c2c
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
258 | 258 |
sub error { |
259 | 259 |
$main::lxdebug->enter_sub(); |
260 | 260 |
|
261 |
$main::lxdebug->full_error_call_trace();
|
|
261 |
$main::lxdebug->show_backtrace();
|
|
262 | 262 |
|
263 | 263 |
my ($self, $msg) = @_; |
264 | 264 |
if ($ENV{HTTP_USER_AGENT}) { |
SL/LXDebug.pm | ||
---|---|---|
1 | 1 |
package LXDebug; |
2 | 2 |
|
3 |
use constant NONE => 0;
|
|
4 |
use constant INFO => 1;
|
|
5 |
use constant DEBUG1 => 2;
|
|
6 |
use constant DEBUG2 => 4;
|
|
7 |
use constant QUERY => 8;
|
|
8 |
use constant TRACE => 16;
|
|
9 |
use constant CALL_TRACE_ON_ERROR => 32;
|
|
10 |
use constant ALL => 63;
|
|
3 |
use constant NONE => 0; |
|
4 |
use constant INFO => 1; |
|
5 |
use constant DEBUG1 => 2; |
|
6 |
use constant DEBUG2 => 4; |
|
7 |
use constant QUERY => 8; |
|
8 |
use constant TRACE => 16; |
|
9 |
use constant BACKTRACE_ON_ERROR => 32;
|
|
10 |
use constant ALL => 63; |
|
11 | 11 |
|
12 | 12 |
use constant FILE_TARGET => 0; |
13 | 13 |
use constant STDERR_TARGET => 1; |
... | ... | |
100 | 100 |
return 1; |
101 | 101 |
} |
102 | 102 |
|
103 |
sub full_error_call_trace {
|
|
103 |
sub show_backtrace {
|
|
104 | 104 |
my ($self) = @_; |
105 | 105 |
|
106 |
return 1 unless ($global_level & CALL_TRACE_ON_ERROR);
|
|
106 |
return 1 unless ($global_level & BACKTRACE_ON_ERROR);
|
|
107 | 107 |
|
108 |
$self->message(CALL_TRACE_ON_ERROR, "Starting full caller dump:");
|
|
108 |
$self->message(BACKTRACE_ON_ERROR, "Starting full caller dump:");
|
|
109 | 109 |
my $level = 0; |
110 | 110 |
while (my ($dummy, $filename, $line, $subroutine) = caller $level) { |
111 |
$self->message(CALL_TRACE_ON_ERROR, "${subroutine} from ${filename}:${line}");
|
|
111 |
$self->message(BACKTRACE_ON_ERROR, "${subroutine} from ${filename}:${line}");
|
|
112 | 112 |
$level++; |
113 | 113 |
} |
114 | 114 |
|
lx-erp.conf | ||
---|---|---|
77 | 77 |
# LXDebug::DEBUG2 |
78 | 78 |
# LXDebug::QUERY - SQL Queries |
79 | 79 |
# LXDebug::TRACE - Tracing von Funktionsaufrufen |
80 |
# LXDebug::CALL_TRACE_ON_ERROR - Vollst?ndiger Aufrufpfad, wenn $form->error() aufgerufen wird
|
|
80 |
# LXDebug::BACKTRACE_ON_ERROR - Vollst?ndiger Aufrufpfad, wenn $form->error() aufgerufen wird
|
|
81 | 81 |
# LXDebug::ALL - alle Debugausgaben |
82 | 82 |
# |
83 | 83 |
# Beipiel: |
Auch abrufbar als: Unified diff
Leicht anderer Name -- es ist im Endeffekt ein stack backtrace, also soll er auch so benannt werden.