line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Logger::Syslog; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
24218447
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
73
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
97
|
|
5
|
2
|
|
|
2
|
|
6
|
use base 'FusionInventory::Agent::Logger::Backend'; |
|
2
|
|
|
|
|
33
|
|
|
2
|
|
|
|
|
457
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1095
|
use Sys::Syslog qw(:standard :macros); |
|
2
|
|
|
|
|
20651
|
|
|
2
|
|
|
|
|
725
|
|
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
|
|
|
|
|
3
|
my $self = {}; |
21
|
1
|
|
|
|
|
2
|
bless $self, $class; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
5
|
openlog("fusinv-agent", 'cons,pid', $params{config}->{logfacility}); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
26
|
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__ |