lib/Ubic/Logger.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 93.5% 29 / 31 SCAR 6.9
CC
2
Cov
91%
ERROR
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Ubic/ServiceLoader/Base.pm ↑ Summary lib/Ubic/SingletonLock.pm »
1 package Ubic::Logger;
2 97 $Ubic::Logger::VERSION = '1.59';
3 97 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 97 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: very simple logging functions
7  
8  
9 97 ▶use Term::ANSIColor qw(:constants);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 97 $Term::ANSIColor::AUTORESET = 1;
11  
12 97 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 97 our @EXPORT = qw( INFO ERROR );
14  
15 sub INFO {
16 136 ▶ print '[', scalar(localtime), "]\t", @_, "\n";
Subroutine INFO: called CC=1 SCAR=0.0
Pod documented
17 }
18  
19 sub ERROR {
20 3 ▶ my @message = ('[', scalar(localtime), "]\t", @_, "\n");
Subroutine ERROR: called CC=2 SCAR=7.6
Pod documented
21 3 ▶ if (-t STDOUT) {
Branch: 1 branch
BranchTrueFalseTotal
if (-t STDOUT) { } 0 3 3
22 0 print RED(@message);
23 }
24 else {
25 3 print @message;
26 }
27 }
28  
29  
30 97 1;
31  
32 __END__
« blib/lib/Ubic/ServiceLoader/Base.pm ↑ Summary lib/Ubic/SingletonLock.pm »