line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Connection::LogMethodCall; |
2
|
|
|
|
|
|
|
#ABSTRACT: ??? |
3
|
|
|
|
|
|
|
$Lab::Connection::LogMethodCall::VERSION = '3.880'; |
4
|
6
|
|
|
6
|
|
3323
|
use v5.20; |
|
6
|
|
|
|
|
32
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
34
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
175
|
|
7
|
6
|
|
|
6
|
|
40
|
use strict; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
143
|
|
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
30
|
use Carp; |
|
6
|
|
|
|
|
26
|
|
|
6
|
|
|
|
|
354
|
|
10
|
6
|
|
|
6
|
|
39
|
use Exporter qw(import); |
|
6
|
|
|
|
|
30
|
|
|
6
|
|
|
|
|
1979
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(dump_method_call); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Return a hashref, which describes the method call. Does not include the |
15
|
|
|
|
|
|
|
# methods's return value. |
16
|
|
|
|
|
|
|
sub dump_method_call { |
17
|
664
|
|
|
664
|
0
|
1043
|
my $id = shift; |
18
|
664
|
|
|
|
|
1018
|
my $method = shift; |
19
|
664
|
|
|
|
|
1243
|
my @args = @_; |
20
|
|
|
|
|
|
|
|
21
|
664
|
|
|
|
|
2062
|
my $log = { |
22
|
|
|
|
|
|
|
id => $id, |
23
|
|
|
|
|
|
|
method => $method, |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
664
|
100
|
|
|
|
2713
|
if ( $method =~ /Clear|block_connection|unblock_connection|is_blocked/ ) { |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# These method take no arguments. |
29
|
316
|
|
|
|
|
789
|
return $log; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
348
|
50
|
|
|
|
775
|
if ( $method eq 'timeout' ) { |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# timeout takes a single argument. |
35
|
0
|
|
|
|
|
0
|
$log->{timeout} = $args[0]; |
36
|
0
|
|
|
|
|
0
|
return $log; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# The remaining methods get either a flat hash or a hashref. |
40
|
|
|
|
|
|
|
|
41
|
348
|
|
|
|
|
501
|
my $config; |
42
|
|
|
|
|
|
|
|
43
|
348
|
100
|
|
|
|
712
|
if ( ref $args[0] eq 'HASH' ) { |
44
|
253
|
|
|
|
|
395
|
$config = $args[0]; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else { |
47
|
95
|
|
|
|
|
187
|
$config = {@args}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
348
|
|
|
|
|
645
|
for my $param (qw/command read_length brutal wait_query/) { |
51
|
1392
|
100
|
|
|
|
2862
|
if ( defined $config->{$param} ) { |
52
|
348
|
|
|
|
|
580
|
my $key = $config->{$param}; |
53
|
348
|
50
|
|
|
|
661
|
if ( ref $key ) { |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Should never happen. |
56
|
0
|
|
|
|
|
0
|
croak "$param is a ref"; |
57
|
|
|
|
|
|
|
} |
58
|
348
|
|
|
|
|
740
|
$log->{$param} = $key; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
348
|
|
|
|
|
915
|
return $log; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=encoding UTF-8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Lab::Connection::LogMethodCall - ??? |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 VERSION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
version 3.880 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Copyright 2016 Simon Reinhardt |
86
|
|
|
|
|
|
|
2017 Andreas K. Huettel |
87
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
91
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |