File Coverage

lib/Ubic/Logger.pm
Criterion Covered Total %
statement 12 17 70.5
branch 0 2 0.0
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 27 66.6


line stmt bran cond sub pod time code
1             package Ubic::Logger;
2             $Ubic::Logger::VERSION = '1.58_01'; # TRIAL
3 4     4   23 use strict;
  4         7  
  4         153  
4 4     4   21 use warnings;
  4         7  
  4         174  
5              
6             # ABSTRACT: very simple logging functions
7              
8              
9 4     4   2697 use Term::ANSIColor qw(:constants);
  4         583222  
  4         3154  
10             $Term::ANSIColor::AUTORESET = 1;
11              
12 4     4   41 use parent qw(Exporter);
  4         8  
  4         32  
13             our @EXPORT = qw( INFO ERROR );
14              
15             sub INFO {
16 0     0 1   print '[', scalar(localtime), "]\t", @_, "\n";
17             }
18              
19             sub ERROR {
20 0     0 1   my @message = ('[', scalar(localtime), "]\t", @_, "\n");
21 0 0         if (-t STDOUT) {
22 0           print RED(@message);
23             }
24             else {
25 0           print @message;
26             }
27             }
28              
29              
30             1;
31              
32             __END__