.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Agent::Priorities 3pm" .TH Agent::Priorities 3pm "2016-09-17" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Log::Agent::Priorities \- conversion between syslog priorities and levels .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& Not intended to be used directly .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package contains routines to convert between syslog priorities and logging levels: level_from_prio(\*(L"crit\*(R") yields 2, and \&\fIprio_from_level\fR\|(4) yields \*(L"warning\*(R", as does \fIprio_from_level\fR\|(5). .PP Here are the known priorities (which may be abbreviated to the first 2 letters, in a case-insensitive manner) and their corresponding logging level: .PP .Vb 11 \& Name Level Traditional Export \& \-\-\-\-\-\-\-\-\- \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \& none \-1 NONE (special, see text) \& emergency 0 (emerg, panic) EMERG \& alert 1 ALERT \& critical 2 (crit) CRIT \& error 3 (err) ERROR \& warning 4 WARN \& notice 6 NOTICE \& info 8 INFO \& debug 10 DEBUG .Ve .PP The values between parenthesis show the traditional syslog priority tokens. The missing levels (5, 7, 9) are there for possible extension. They currently map to the level immediately below. .PP The Export column lists the symbolic constants defined by this package. They can be imported selectively, or alltogether via the \f(CW\*(C`:LEVELS\*(C'\fR tag, as in: .PP .Vb 1 \& use Log::Agent::Priorities qw(:LEVELS); .Ve .PP The special token \*(L"none\*(R" may be used (and spelled out fully) on special occasions: it maps to \-1, and is convenient when specifying a logging level, for instance: specifying \*(L"none\*(R" ensures that \fBno logging\fR will take place, even for emergency situations. .PP Anywhere where a \fIpriority\fR is expected, one may specify a number taken as a logging level or a string taken as a priority. If the default mapping outlined above is not satisfactory, it can be redefined by specifying, for instance \f(CW"notice:9"\fR. It will be taken as being of level 9, but with a \f(CW\*(C`notice\*(C'\fR priority nonetheless, not \f(CW\*(C`info\*(C'\fR as it would have been implicitely determined otherwise. .PP The routine \fIpriority_level()\fR decompiles \f(CW"notice:9"\fR into (\*(L"notice\*(R", 9), and otherwise uses \fIprio_from_level()\fR or \fIlevel_from_prio()\fR to compute the missing informatin. For instance, given \*(L"critical\*(R", \fIpriority_level()\fR routine will return the tuple (\*(L"critical\*(R", 2). .SH "AUTHOR" .IX Header "AUTHOR" Raphael Manfredi \fI\fR .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fILog::Agent\fR\|(3), \fILog::Agent::Logger\fR\|(3).