Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4b17bfa8

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID 4b17bfa891c1dd495558090ef8f558a51222b7a3
  • Vorgänger 8ef6c902
  • Nachfolger 142f7c2c

Mehr Debugmöglichkeiten für DBUtils.pm und allgemein für Fehlersituationen eingeführt, die über $form->error() signalisiert werden.

Unterschiede anzeigen:

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 ALL    => 31;
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;
10 11

  
11 12
use constant FILE_TARGET   => 0;
12 13
use constant STDERR_TARGET => 1;
......
99 100
  return 1;
100 101
}
101 102

  
103
sub full_error_call_trace {
104
  my ($self) = @_;
105

  
106
  return 1 unless ($global_level & CALL_TRACE_ON_ERROR);
107

  
108
  $self->message(CALL_TRACE_ON_ERROR, "Starting full caller dump:");
109
  my $level = 0;
110
  while (my ($dummy, $filename, $line, $subroutine) = caller $level) {
111
    $self->message(CALL_TRACE_ON_ERROR, "${subroutine} from ${filename}:${line}");
112
    $level++;
113
  }
114

  
115
  return 1;
116
}
117

  
102 118
sub message {
103 119
  my ($self, $level, $message) = @_;
104 120

  
......
146 162

  
147 163
sub level2string {
148 164
  # use $_[0] as a bit mask and return levelstrings separated by /
149
  join '/', qw(info debug1 debug2 query trace)[ grep { (reverse split //, sprintf "%05b", $_[0])[$_] } 0..4 ]
165
  join '/', qw(info debug1 debug2 query trace error_call_trace)[ grep { (reverse split //, sprintf "%05b", $_[0])[$_] } 0..5 ]
150 166
}
151 167

  
152 168
1;

Auch abrufbar als: Unified diff