line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# ABSTRACT: something that produces a debug messages |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use strict; |
5
|
14
|
|
|
14
|
|
14113
|
use warnings; |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
357
|
|
6
|
14
|
|
|
14
|
|
61
|
use Moo::Role; |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
279
|
|
7
|
14
|
|
|
14
|
|
63
|
use namespace::autoclean; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
84
|
|
8
|
14
|
|
|
14
|
|
5025
|
use Data::Dumper; |
|
14
|
|
|
|
|
11052
|
|
|
14
|
|
|
|
|
81
|
|
9
|
14
|
|
|
14
|
|
8166
|
use Carp; |
|
14
|
|
|
|
|
78745
|
|
|
14
|
|
|
|
|
716
|
|
10
|
14
|
|
|
14
|
|
86
|
|
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
1872
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.052'; # VERSION |
12
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:CHIM'; # AUTHORITY |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my ($self, @garbage) = @_; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
1
|
18138
|
local $Data::Dumper::Terse = 1; |
17
|
|
|
|
|
|
|
local $Data::Dumper::Indent = 0; |
18
|
6
|
|
|
|
|
10
|
local $Data::Dumper::Useqq = 1; |
19
|
6
|
|
|
|
|
11
|
local $Data::Dumper::Pair = ': '; |
20
|
6
|
|
|
|
|
18
|
local $Data::Dumper::Sortkeys = 1; |
21
|
6
|
|
|
|
|
15
|
|
22
|
6
|
|
|
|
|
9
|
my $msg = join ' ' => map { (ref $_ ? Dumper($_) : $_) } @garbage; |
23
|
|
|
|
|
|
|
|
24
|
6
|
100
|
|
|
|
12
|
carp $msg; |
|
17
|
|
|
|
|
210
|
|
25
|
|
|
|
|
|
|
} |
26
|
6
|
|
|
|
|
641
|
|
27
|
|
|
|
|
|
|
1; # End of Regru::API::Role::Loggable |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Regru::API::Role::Loggable - something that produces a debug messages |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 0.052 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package Regru::API::Dummy; |
45
|
|
|
|
|
|
|
... |
46
|
|
|
|
|
|
|
with 'Regru::API::Role::Loggable'; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# inside some method |
49
|
|
|
|
|
|
|
sub foo { |
50
|
|
|
|
|
|
|
my ($self) = @_; |
51
|
|
|
|
|
|
|
... |
52
|
|
|
|
|
|
|
$ref = { -answer => 42 }; |
53
|
|
|
|
|
|
|
$sclr = 'quux'; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$self->debug_warn('Foo:', 'bar', 'baz', $ref, $sclr, qw(knock, knock)); |
56
|
|
|
|
|
|
|
# will warn |
57
|
|
|
|
|
|
|
# Foo: bar baz {"-answer": 42} quux knock, knock at ... |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Role provides the method which will be useful for debugging requests and responses. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 METHODS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 debug_warn |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Produces a warning message for a given list of agruments. All passed references (ArrayRef, HashRef or blessed) |
69
|
|
|
|
|
|
|
will be flatten to the scalars. Output message will be done by joining scalars with C<space> character as separator. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L<Regru::API> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<Regru::API::Role::Client> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 BUGS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
80
|
|
|
|
|
|
|
L<https://github.com/regru/regru-api-perl/issues> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
83
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
84
|
|
|
|
|
|
|
feature. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHORS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=over 4 |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Polina Shubina <shubina@reg.ru> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Anton Gerasimov <a.gerasimov@reg.ru> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=back |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This software is copyright (c) 2013 by REG.RU LLC. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
105
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |