line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 Name |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
qbit::Log - Functions to logging |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=cut |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package qbit::Log; |
8
|
|
|
|
|
|
|
$qbit::Log::VERSION = '2.4'; |
9
|
8
|
|
|
8
|
|
26
|
use strict; |
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
176
|
|
10
|
8
|
|
|
8
|
|
23
|
use warnings; |
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
135
|
|
11
|
8
|
|
|
8
|
|
25
|
use utf8; |
|
8
|
|
|
|
|
6
|
|
|
8
|
|
|
|
|
31
|
|
12
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
143
|
use base qw(Exporter); |
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
365
|
|
14
|
8
|
|
|
8
|
|
27
|
use Data::Dumper; |
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
559
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
BEGIN { |
17
|
8
|
|
|
8
|
|
12
|
our (@EXPORT, @EXPORT_OK); |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
14
|
@EXPORT = qw( |
20
|
|
|
|
|
|
|
l ldump |
21
|
|
|
|
|
|
|
); |
22
|
8
|
|
|
|
|
1028
|
@EXPORT_OK = @EXPORT; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 Functions |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 l |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
B |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=over |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
B<@args> - array of strings, messages; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=back |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Print joined messsages to STDERR with new line at end. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub l { |
45
|
0
|
|
|
0
|
1
|
|
print STDERR join(' ', @_) . "\n"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 ldump |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
B |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=over |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
B<@args> - array, variables; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=back |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Print variables dumps with Data::Dumper::Dumper to STDERR. Unicode sequenses will be converted to readable text. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub ldump(@) { |
65
|
0
|
|
|
0
|
1
|
|
local $Data::Dumper::Indent = 2; |
66
|
0
|
|
|
|
|
|
local $Data::Dumper::Varname = ''; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
my $dump = Dumper(@_); |
69
|
0
|
|
|
|
|
|
$dump =~ s/\\x\{([a-f0-9]{2,})\}/chr(hex($1))/ge; |
|
0
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
print STDERR $dump; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |