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.3'; |
9
|
8
|
|
|
8
|
|
42
|
use strict; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
280
|
|
10
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
233
|
|
11
|
8
|
|
|
8
|
|
34
|
use utf8; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
53
|
|
12
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
239
|
use base qw(Exporter); |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
1716
|
|
14
|
8
|
|
|
8
|
|
2225
|
use Data::Dumper; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
3254
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
BEGIN { |
17
|
8
|
|
|
8
|
|
13
|
our (@EXPORT, @EXPORT_OK); |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
22
|
@EXPORT = qw( |
20
|
|
|
|
|
|
|
l ldump |
21
|
|
|
|
|
|
|
); |
22
|
8
|
|
|
|
|
1561
|
@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; |