App/TenableSC/Logger.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 83.3% 5 / 6 totaltotal 52.7% 19 / 36 CC 1 SCAR 5.1
CC
1
Cov
52%
new
2.0
log
2.0
info
2.0
CRAP 1.7
« Net/SecurityCenter.pm ↑ Summary Net/SecurityCenter/Error.pm »
1 package App::TenableSC::Logger;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Time::Piece;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.310';
9  
10 #-------------------------------------------------------------------------------
11 # CONSTRUCTOR
12 #-------------------------------------------------------------------------------
13  
14 sub new {
15 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
16 0 return bless {}, $class;
17 }
18  
19 #-------------------------------------------------------------------------------
20  
21 sub log {
22 0 ▶ my ( $self, $level, $message ) = @_;
Subroutine log: not called CC=1 SCAR=6.9
Pod undocumented
23  
24 0 my $now = Time::Piece->new->datetime;
25 0 print STDERR "[$now] [$$] $level - $message\n";
26  
27 0 return;
28 }
29  
30 #-------------------------------------------------------------------------------
31  
32 0 ▶sub info { shift->log( 'INFO', shift ) }
Subroutine info: not called CC=1 SCAR=6.9
Pod documented
33 0 ▶sub debug { shift->log( 'DEBUG', shift ) }
Subroutine debug: not called CC=1 SCAR=6.9
Pod documented
34 0 ▶sub warning { shift->log( 'WARNING', shift ) }
Subroutine warning: not called CC=1 SCAR=6.9
Pod documented
35 0 ▶sub error { shift->log( 'ERROR', shift ) }
Subroutine error: not called CC=1 SCAR=6.9
Pod documented
36  
37 #-------------------------------------------------------------------------------
38  
39 1 1;
40  
41 __END__
« Net/SecurityCenter.pm ↑ Summary Net/SecurityCenter/Error.pm »