| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::DevPopup::Log; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$CGI::Application::Plugin::DevPopup::Log::VERSION = '1.08'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
31067
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
38
|
|
|
7
|
1
|
|
|
1
|
|
917
|
use IO::Scalar; |
|
|
1
|
|
|
|
|
17735
|
|
|
|
1
|
|
|
|
|
50
|
|
|
8
|
1
|
|
|
1
|
|
9
|
use base qw/Exporter/; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
119
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION @EXPORT); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
409
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@EXPORT = qw(devpopup_log_handle); |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
0
|
|
|
0
|
|
|
my $c = scalar caller; |
|
16
|
0
|
|
|
|
|
|
$c->add_callback( 'devpopup_report', \&_header_report ); |
|
17
|
0
|
|
|
|
|
|
goto &Exporter::import; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _header_report |
|
21
|
|
|
|
|
|
|
{ |
|
22
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
23
|
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $log = _log_report($self); |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$self->devpopup->add_report( |
|
27
|
|
|
|
|
|
|
title => 'Logs', |
|
28
|
|
|
|
|
|
|
summary => '', |
|
29
|
|
|
|
|
|
|
report => qq( |
|
30
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
) |
|
35
|
|
|
|
|
|
|
); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _log_report |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
41
|
0
|
|
|
|
|
|
my $data = $self->{__DEVPOPUP_LOGDATA}; |
|
42
|
0
|
0
|
|
|
|
|
return '' unless (ref $data eq 'SCALAR'); |
|
43
|
0
|
|
|
|
|
|
my $r=0; |
|
44
|
0
|
|
|
|
|
|
my $report = join $/, map { |
|
45
|
0
|
|
|
|
|
|
$r=1-$r; |
|
46
|
0
|
0
|
|
|
|
|
qq{ |
| $_ |
}
|
|
0
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
split /\n/, $$data; |
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $report; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub devpopup_log_handle |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
|
56
|
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
unless (ref $this->{__DEVPOPUP_LOGFH}) |
|
58
|
|
|
|
|
|
|
{ |
|
59
|
0
|
|
|
|
|
|
my $data = ''; |
|
60
|
0
|
|
|
|
|
|
$this->{__DEVPOPUP_LOGDATA} = \$data; |
|
61
|
0
|
|
|
|
|
|
my $fh = new IO::Scalar \$data; |
|
62
|
0
|
|
|
|
|
|
$this->{__DEVPOPUP_LOGFH} = $fh; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return $this->{__DEVPOPUP_LOGFH}; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of CGI::Application::Plugin::DevPopup::Log |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |