line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Ubic::Logger; |
2
|
|
|
|
|
|
|
$Ubic::Logger::VERSION = '1.60'; |
3
|
5
|
|
|
5
|
|
58
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
119
|
|
4
|
5
|
|
|
5
|
|
17
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
124
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: very simple logging functions |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
2818
|
use Term::ANSIColor qw(:constants); |
|
5
|
|
|
|
|
25766
|
|
|
5
|
|
|
|
|
3006
|
|
10
|
|
|
|
|
|
|
$Term::ANSIColor::AUTORESET = 1; |
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
|
34
|
use parent qw(Exporter); |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
41
|
|
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__ |