| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package XAS::Lib::Log::Syslog; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1370
|
use Sys::Syslog qw(:standard :extended); |
|
|
1
|
|
|
|
|
5134
|
|
|
|
1
|
|
|
|
|
129
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use XAS::Class |
|
8
|
1
|
|
|
|
|
11
|
debug => 0, |
|
9
|
|
|
|
|
|
|
version => $VERSION, |
|
10
|
|
|
|
|
|
|
base => 'XAS::Base', |
|
11
|
|
|
|
|
|
|
utils => ':validation level2syslog', |
|
12
|
|
|
|
|
|
|
constants => 'HASHREF', |
|
13
|
1
|
|
|
1
|
|
5
|
; |
|
|
1
|
|
|
|
|
1
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
16
|
|
|
|
|
|
|
# Public Methods |
|
17
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub output { |
|
20
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
21
|
0
|
|
|
|
|
|
my ($args) = validate_params(\@_, [ |
|
22
|
|
|
|
|
|
|
{ type => HASHREF } |
|
23
|
|
|
|
|
|
|
]); |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $priority = level2syslog(lc($args->{'priority'})); |
|
26
|
0
|
|
|
|
|
|
my $message = sprintf('%s', $args->{'message'}); |
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
syslog($priority, $message); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub DESTROY { |
|
33
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
closelog(); |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
40
|
|
|
|
|
|
|
# Private Methods |
|
41
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub init { |
|
44
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
|
45
|
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $self = $class->SUPER::init(@_); |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
setlogsock('unix'); |
|
49
|
0
|
|
|
|
|
|
openlog($self->env->script, 'pid', $self->env->log_facility); |
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return $self; |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |