line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Debug; |
2
|
|
|
|
|
|
|
|
3
|
22
|
|
|
22
|
|
378
|
use 5.014; |
|
22
|
|
|
|
|
75
|
|
4
|
22
|
|
|
22
|
|
109
|
use strict; |
|
22
|
|
|
|
|
43
|
|
|
22
|
|
|
|
|
419
|
|
5
|
22
|
|
|
22
|
|
102
|
use warnings; |
|
22
|
|
|
|
|
38
|
|
|
22
|
|
|
|
|
543
|
|
6
|
22
|
|
|
22
|
|
97
|
use Exporter 'import'; |
|
22
|
|
|
|
|
57
|
|
|
22
|
|
|
|
|
2786
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(_debug); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
GraphQL::Debug - debug GraphQL |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use GraphQL::Debug qw(_debug); |
19
|
|
|
|
|
|
|
use constant DEBUG => $ENV{GRAPHQL_DEBUG}; |
20
|
|
|
|
|
|
|
DEBUG and _debug('current_function', $value1, $value2); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Creates debugging output when called. Intended to have its calls optimised |
25
|
|
|
|
|
|
|
out when debugging not sought, using the construct shown above. The |
26
|
|
|
|
|
|
|
values given will be passed through L<Data::Dumper/Dumper>. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# TODO make log instead of diag |
31
|
|
|
|
|
|
|
sub _debug { |
32
|
1
|
|
|
1
|
|
10105
|
my $func = shift; |
33
|
1
|
|
|
|
|
7
|
require Test::More; |
34
|
1
|
50
|
|
|
|
9
|
Test::More::diag("$func: ", Test::More::explain(@_ == 1 ? @_ : [ @_ ])); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |