line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Syslog::Constants; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23034
|
use 5.6.2; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
51
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# severities |
10
|
1
|
|
|
1
|
|
4
|
use constant LOG_EMERG => 0; # system is unusable |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
11
|
1
|
|
|
1
|
|
5
|
use constant LOG_ALERT => 1; # action must be taken immediately |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
12
|
1
|
|
|
1
|
|
4
|
use constant LOG_CRIT => 2; # critical conditions |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
47
|
|
13
|
1
|
|
|
1
|
|
4
|
use constant LOG_ERR => 3; # error conditions |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
14
|
1
|
|
|
1
|
|
4
|
use constant LOG_WARNING => 4; # warning conditions |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
15
|
1
|
|
|
1
|
|
5
|
use constant LOG_NOTICE => 5; # normal but significant condition |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
16
|
1
|
|
|
1
|
|
4
|
use constant LOG_INFO => 6; # informational |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
17
|
1
|
|
|
1
|
|
5
|
use constant LOG_DEBUG => 7; # debug-level messages |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# facilities |
20
|
1
|
|
|
1
|
|
5
|
use constant LOG_KERN => 0; # kernel messages |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
21
|
1
|
|
|
1
|
|
5
|
use constant LOG_USER => 1; # random user-level messages |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
22
|
1
|
|
|
1
|
|
14
|
use constant LOG_MAIL => 2; # mail system |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
23
|
1
|
|
|
1
|
|
4
|
use constant LOG_DAEMON => 3; # system daemons |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
24
|
1
|
|
|
1
|
|
4
|
use constant LOG_AUTH => 4; # security/authorization messages |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
25
|
1
|
|
|
1
|
|
5
|
use constant LOG_SYSLOG => 5; # messages generated internally by syslogd |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
63
|
|
26
|
1
|
|
|
1
|
|
5
|
use constant LOG_LPR => 6; # line printer subsystem |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
27
|
1
|
|
|
1
|
|
5
|
use constant LOG_NEWS => 7; # network news subsystem |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
28
|
1
|
|
|
1
|
|
4
|
use constant LOG_UUCP => 8; # UUCP subsystem |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
29
|
1
|
|
|
1
|
|
4
|
use constant LOG_CRON => 9; # clock daemon |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
30
|
1
|
|
|
1
|
|
4
|
use constant LOG_AUTHPRIV => 10; # security/authorization messages (private) |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
31
|
1
|
|
|
1
|
|
4
|
use constant LOG_FTP => 11; # ftp daemon |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
32
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL0 => 16; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
33
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL1 => 17; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
34
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL2 => 18; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
35
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL3 => 19; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
36
|
1
|
|
|
1
|
|
5
|
use constant LOG_LOCAL4 => 20; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
37
|
1
|
|
|
1
|
|
5
|
use constant LOG_LOCAL5 => 21; # reserved for local use |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
38
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL6 => 22; # reserved for local use |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
39
|
1
|
|
|
1
|
|
4
|
use constant LOG_LOCAL7 => 23; # reserved for local use |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
536
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my %_severities_by_name = ( |
42
|
|
|
|
|
|
|
emerg => LOG_EMERG, |
43
|
|
|
|
|
|
|
alert => LOG_ALERT, |
44
|
|
|
|
|
|
|
crit => LOG_CRIT, |
45
|
|
|
|
|
|
|
err => LOG_ERR, |
46
|
|
|
|
|
|
|
warning => LOG_WARNING, |
47
|
|
|
|
|
|
|
notice => LOG_NOTICE, |
48
|
|
|
|
|
|
|
info => LOG_INFO, |
49
|
|
|
|
|
|
|
debug => LOG_DEBUG, |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my %_facilities_by_name = ( |
53
|
|
|
|
|
|
|
kern => LOG_KERN, |
54
|
|
|
|
|
|
|
user => LOG_USER, |
55
|
|
|
|
|
|
|
mail => LOG_MAIL, |
56
|
|
|
|
|
|
|
daemon => LOG_DAEMON, |
57
|
|
|
|
|
|
|
auth => LOG_AUTH, |
58
|
|
|
|
|
|
|
syslog => LOG_SYSLOG, |
59
|
|
|
|
|
|
|
lpr => LOG_LPR, |
60
|
|
|
|
|
|
|
news => LOG_NEWS, |
61
|
|
|
|
|
|
|
uucp => LOG_UUCP, |
62
|
|
|
|
|
|
|
cron => LOG_CRON, |
63
|
|
|
|
|
|
|
authpriv => LOG_AUTHPRIV, |
64
|
|
|
|
|
|
|
ftp => LOG_FTP, |
65
|
|
|
|
|
|
|
local0 => LOG_LOCAL0, |
66
|
|
|
|
|
|
|
local1 => LOG_LOCAL1, |
67
|
|
|
|
|
|
|
local2 => LOG_LOCAL2, |
68
|
|
|
|
|
|
|
local3 => LOG_LOCAL3, |
69
|
|
|
|
|
|
|
local4 => LOG_LOCAL4, |
70
|
|
|
|
|
|
|
local5 => LOG_LOCAL5, |
71
|
|
|
|
|
|
|
local6 => LOG_LOCAL6, |
72
|
|
|
|
|
|
|
local7 => LOG_LOCAL7, |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub get_severity { |
76
|
9
|
|
|
9
|
1
|
9523
|
$_severities_by_name{lc $_[0]}; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub get_facility { |
80
|
21
|
|
|
21
|
1
|
98
|
$_facilities_by_name{lc $_[0]}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
require Exporter; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
88
|
|
|
|
|
|
|
severities => [qw/ |
89
|
|
|
|
|
|
|
LOG_EMERG LOG_ALERT LOG_CRIT LOG_ERR LOG_WARNING |
90
|
|
|
|
|
|
|
LOG_NOTICE LOG_INFO LOG_DEBUG |
91
|
|
|
|
|
|
|
/], |
92
|
|
|
|
|
|
|
facilities => [qw/ |
93
|
|
|
|
|
|
|
LOG_KERN LOG_USER LOG_MAIL LOG_DAEMON LOG_AUTH |
94
|
|
|
|
|
|
|
LOG_SYSLOG LOG_LPR LOG_NEWS LOG_UUCP LOG_CRON |
95
|
|
|
|
|
|
|
LOG_AUTHPRIV LOG_FTP LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2 |
96
|
|
|
|
|
|
|
LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 |
97
|
|
|
|
|
|
|
/], |
98
|
|
|
|
|
|
|
functions => [qw/ |
99
|
|
|
|
|
|
|
get_severity get_facility |
100
|
|
|
|
|
|
|
/], |
101
|
|
|
|
|
|
|
); |
102
|
|
|
|
|
|
|
@{ $EXPORT_TAGS{'all'} } = ( |
103
|
|
|
|
|
|
|
@{ $EXPORT_TAGS{'facilities'} }, |
104
|
|
|
|
|
|
|
@{ $EXPORT_TAGS{'severities'} }, |
105
|
|
|
|
|
|
|
@{ $EXPORT_TAGS{'functions'} }, |
106
|
|
|
|
|
|
|
); |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
our @EXPORT_OK = @{ $EXPORT_TAGS{'all'} }; |
109
|
|
|
|
|
|
|
our @EXPORT = qw(); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
__END__ |