GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Agent::Priorities(3) User Contributed Perl Documentation Agent::Priorities(3)

Log::Agent::Priorities - conversion between syslog priorities and levels

 Not intended to be used directly

This package contains routines to convert between syslog priorities and logging levels: level_from_prio("crit") yields 2, and prio_from_level(4) yields "warning", 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 ":LEVELS" tag, as in:

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

The special token "none" 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 "none" 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 "notice" priority nonetheless, not "info" as it would have been implicitely determined otherwise.

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

Raphael Manfredi <Raphael_Manfredi@pobox.com>

Log::Agent(3), Log::Agent::Logger(3).
2021-04-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.