line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Logger::Syslog; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20502738
|
use strict; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
104
|
|
4
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
107
|
|
5
|
1
|
|
|
1
|
|
14
|
use base 'FusionInventory::Agent::Logger::Backend'; |
|
1
|
|
|
|
|
54
|
|
|
1
|
|
|
|
|
742
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
2460
|
use Sys::Syslog qw(:standard :macros); |
|
1
|
|
|
|
|
30963
|
|
|
1
|
|
|
|
|
806
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %syslog_levels = ( |
10
|
|
|
|
|
|
|
error => LOG_ERR, |
11
|
|
|
|
|
|
|
warning => LOG_WARNING, |
12
|
|
|
|
|
|
|
info => LOG_INFO, |
13
|
|
|
|
|
|
|
debug => LOG_DEBUG, |
14
|
|
|
|
|
|
|
debu2 => LOG_DEBUG |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
0
|
|
|
0
|
1
|
|
my ($class, %params) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $self = {}; |
21
|
0
|
|
|
|
|
|
bless $self, $class; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
openlog("fusinv-agent", 'cons,pid', $params{config}->{logfacility}); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub addMessage { |
29
|
0
|
|
|
0
|
1
|
|
my ($self, %params) = @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my $level = $params{level}; |
32
|
0
|
|
|
|
|
|
my $message = $params{message}; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
syslog($syslog_levels{$level}, $message); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub DESTROY { |
38
|
0
|
|
|
0
|
|
|
closelog(); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |