SYNOPSIS

 Not intended to be used directly

DESCRIPTION

This package contains routines to convert between syslog priorities and logging levels: level_from_prio(\*(L"crit\*(R") yields 2, and prio_from_level\|(4) yields \*(L"warning\*(R", as does prio_from_level\|(5).

Here are the known priorities (which may be abbreviated to the first 2 letters, in a case-insensitive manner) and their corresponding logging level:

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

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.

The Export column lists the symbolic constants defined by this package. They can be imported selectively, or alltogether via the \*(C`:LEVELS\*(C' tag, as in:

use Log::Agent::Priorities qw(:LEVELS);

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 no logging will take place, even for emergency situations.

Anywhere where a priority 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 "notice:9". It will be taken as being of level 9, but with a \*(C`notice\*(C' priority nonetheless, not \*(C`info\*(C' as it would have been implicitely determined otherwise.

The routine priority_level() decompiles "notice:9" into (\*(L"notice\*(R", 9), and otherwise uses prio_from_level() or level_from_prio() to compute the missing informatin. For instance, given \*(L"critical\*(R", priority_level() routine will return the tuple (\*(L"critical\*(R", 2).

AUTHOR

Raphael Manfredi <[email protected]>

RELATED TO Log::Agent::Priorities…

Log::Agent\|(3), Log::Agent::Logger\|(3).