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.59';
3 5     5   40 use strict;
  5         5  
  5         108  
4 5     5   12 use warnings;
  5         5  
  5         100  
5              
6             # ABSTRACT: very simple logging functions
7              
8              
9 5     5   12068 use Term::ANSIColor qw(:constants);
  5         22205  
  5         2499  
10             $Term::ANSIColor::AUTORESET = 1;
11              
12 5     5   24 use parent qw(Exporter);
  5         9  
  5         33  
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__