line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::TenableSC::Logger; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Time::Piece; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.310'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
11
|
|
|
|
|
|
|
# CONSTRUCTOR |
12
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
16
|
0
|
|
|
|
|
|
return bless {}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub log { |
22
|
0
|
|
|
0
|
0
|
|
my ( $self, $level, $message ) = @_; |
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
|
|
|
0
|
1
|
|
sub info { shift->log( 'INFO', shift ) } |
33
|
0
|
|
|
0
|
1
|
|
sub debug { shift->log( 'DEBUG', shift ) } |
34
|
0
|
|
|
0
|
1
|
|
sub warning { shift->log( 'WARNING', shift ) } |
35
|
0
|
|
|
0
|
1
|
|
sub error { shift->log( 'ERROR', shift ) } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |