line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
XAO::DO::Web::Debug - debug helper object |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
<%Debug text="Got here :)"%> |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
<%Debug set="show-path"%> |
10
|
|
|
|
|
|
|
<%Page path="/bits/some-complex-template-that-fails"%> |
11
|
|
|
|
|
|
|
<%Debug clear="show-path"%> |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Allows to to spit debug messages into error_log and/or turn on or off |
16
|
|
|
|
|
|
|
various debug parameters in Page. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
XXX - incomplete description! |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
############################################################################### |
23
|
|
|
|
|
|
|
package XAO::DO::Web::Debug; |
24
|
1
|
|
|
1
|
|
877
|
use XAO::Utils; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
85
|
|
25
|
1
|
|
|
1
|
|
6
|
use XAO::Objects; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
26
|
1
|
|
|
1
|
|
4
|
use base XAO::Objects->load(objname => 'Web::Page'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
our $VERSION='2.001'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
############################################################################### |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub display ($%) { |
33
|
2
|
|
|
2
|
1
|
4
|
my $self=shift; |
34
|
2
|
|
|
|
|
5
|
my $args=get_args(\@_); |
35
|
|
|
|
|
|
|
|
36
|
2
|
50
|
|
|
|
17
|
if($args->{on}) { |
37
|
0
|
|
|
|
|
0
|
XAO::Utils::set_debug(1); |
38
|
0
|
|
|
|
|
0
|
dprint "Debug on"; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
2
|
50
|
|
|
|
5
|
if($args->{off}) { |
42
|
0
|
|
|
|
|
0
|
dprint "Debug off"; |
43
|
0
|
|
|
|
|
0
|
XAO::Utils::set_debug(0); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
2
|
50
|
|
|
|
5
|
if($args->{set}) { |
47
|
2
|
|
|
|
|
13
|
my %set=map { $_ => 1 } split(/[,;\s]/,$args->{set}); |
|
3
|
|
|
|
|
13
|
|
48
|
2
|
|
|
|
|
11
|
$self->debug_set(\%set); |
49
|
2
|
|
|
|
|
88
|
dprint "Debug set='",join(',',keys %set),"'"; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
2
|
100
|
|
|
|
13
|
if($args->{clear}) { |
53
|
1
|
|
|
|
|
4
|
my %set=map { $_ => 0 } split(/[,;\s]/,$args->{clear}); |
|
1
|
|
|
|
|
4
|
|
54
|
1
|
|
|
|
|
6
|
$self->debug_set(\%set); |
55
|
1
|
|
|
|
|
37
|
dprint "Debug clear='",join(',',keys %set),"'"; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
2
|
50
|
33
|
|
|
21
|
if(defined($args->{text}) || defined($args->{template}) || $args->{path}) { |
|
|
|
33
|
|
|
|
|
59
|
|
|
|
|
|
|
my $text=$args->{text} || |
60
|
0
|
|
0
|
|
|
|
$self->object->expand($args); |
61
|
0
|
|
|
|
|
|
dprint $self->{objname}," - $text"; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
############################################################################### |
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
__END__ |