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