Agent/Driver/Silent.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 29.4% 5 / 17 Podpod 86.6% 13 / 15 totaltotal 65.3% 34 / 52 CC 1 SCAR 1.6
CC
1
Cov
80%
channel_eq
2.0
logconfess
2.0
logdie
2.0
CRAP 1.2
« Agent/Driver/Default.pm ↑ Summary Agent/File/Native.pm »
1 ###########################################################################
2 #
3 # Silent.pm
4 #
5 # Copyright (C) 1999 Raphael Manfredi.
6 # Copyright (C) 2002-2017 Mark Rogaski, mrogaski@cpan.org;
7 # all rights reserved.
8 #
9 # See the README file included with the
10 # distribution for license information.
11 #
12 ##########################################################################
13  
14 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 require Log::Agent::Driver;
16  
17 ########################################################################
18 package Log::Agent::Driver::Silent;
19  
20 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 @ISA = qw(Log::Agent::Driver);
23  
24 #
25 # ->make -- defined
26 #
27 # Creation routine.
28 #
29 1 ▶sub make {
Subroutine make: called CC=1 SCAR=0.0
Pod documented
30 1 my $self = bless {}, shift;
31 1 return $self;
32 }
33  
34 #
35 # NOP routines.
36 #
37  
38 0 ▶sub prefix_msg {}
Subroutine prefix_msg: not called CC=1 SCAR=0.0
Pod documented
39 0 ▶sub emit {}
Subroutine emit: not called CC=1 SCAR=0.0
Pod documented
40 0 ▶sub channel_eq { 1 }
Subroutine channel_eq: not called CC=1 SCAR=6.9
Pod documented
41  
42 #
43 # In theory, we could live with the above NOP ops and the logxxx()
44 # routines would not do anything. Let's redefine them though...
45 #
46  
47 0 ▶sub logerr {}
Subroutine logerr: not called CC=1 SCAR=0.0
Pod documented
48 0 ▶sub logwarn {}
Subroutine logwarn: not called CC=1 SCAR=0.0
Pod documented
49 0 ▶sub logcluck {}
Subroutine logcluck: not called CC=1 SCAR=0.0
Pod documented
50 0 ▶sub logsay {}
Subroutine logsay: not called CC=1 SCAR=0.0
Pod documented
51 0 ▶sub loginfo {}
Subroutine loginfo: not called CC=1 SCAR=0.0
Pod undocumented
52 0 ▶sub logdebug {}
Subroutine logdebug: not called CC=1 SCAR=0.0
Pod undocumented
53 0 ▶sub logwrite {}
Subroutine logwrite: not called CC=1 SCAR=0.0
Pod documented
54 1 ▶sub logxcarp {}
Subroutine logxcarp: called CC=1 SCAR=0.0
Pod documented
55  
56 #
57 # Those need minimal processing.
58 # We explicitely stringify the string argument (uses overloaded "" method)
59 #
60  
61 0 ▶sub logconfess { require Carp; Carp::confess("$_[1]"); }
Subroutine logconfess: not called CC=1 SCAR=6.9
Pod documented
62 0 ▶sub logdie { die "$_[0]\n"; }
Subroutine logdie: not called CC=1 SCAR=6.9
Pod documented
63  
64 #
65 # ->logxcroak -- redefined
66 #
67 # Handle the offset parameter correctly
68 #
69 1 ▶sub logxcroak {
Subroutine logxcroak: called CC=1 SCAR=0.0
Pod documented
70 1 my $self = shift;
71 1 my ($offset, $str) = @_;
72 1 require Carp;
73 1 my $msg = $self->carpmess($offset, $str, \&Carp::shortmess);
74 1 die "$msg\n";
75 }
76  
77 1 1; # for require
78 __END__
« Agent/Driver/Default.pm ↑ Summary Agent/File/Native.pm »