WiX3/Trace/Object.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 2 SCAR 11.0
CC
2
Cov
0%
trace_line
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.0
1 package # Hide from PAUSE.
2 WiX3::Trace::Object;
3  
4 use 5.008003;
5 use MooseX::Singleton;
6 use WiX3::Util::StrictConstructor;
7 use WiX3::Types qw( Tracelevel );
8 use MooseX::Types::Moose qw( Bool );
9  
10 our $VERSION = '0.011';
11  
12 has tracelevel => (
13 is => 'rw',
14 isa => Tracelevel,
15 reader => 'get_tracelevel',
16 writer => 'set_tracelevel',
17 default => 1,
18 );
19  
20 has testing => (
21 is => 'ro',
22 isa => Bool,
23 reader => 'get_testing',
24 default => 0,
25 );
26  
27 sub trace_line {
28 my $self = shift;
29 my ( $level, $text ) = @_;
30  
31 # We hit this routine so many times that it accumulates
32 # a minute's worth of time when building Strawberry 5.12.0
33 # 64-bit. (profiling by NYTProf)
34 # I would not normally break encapsulation like this.
35 if ( $level <= $self->{tracelevel} ) {
36 print $text;
37 }
38  
39 return $text;
40 } ## end sub trace_line
41  
42 no MooseX::Singleton;
43 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
44  
45 1; # Magic true value required at end of module