gone: github.com/proidiot/gone/log/pri Index | Files

package pri

import "github.com/proidiot/gone/log/pri"

Index

Package Files

priority.go

type Priority Uses

type Priority byte

Priority represents a log priority (bitwise or of facility and severity). See RFC 3164 Section 4.1.1, RFC 5424 Section 6.2.1, and RFC 5427 Section 3.

const (
    // Emerg represents an emergency; system is unusable.
    Emerg Priority = 0
    // Alert represents than an action must be taken immediately.
    Alert Priority = 1
    // Crit represents a critical condition.
    Crit Priority = 2
    // Err represents an error condition.
    Err Priority = 3
    // Warning represents a warning condition.
    Warning Priority = 4
    // Notice represents a normal but significant condition.
    Notice Priority = 5
    // Info represents an informational message.
    Info Priority = 6
    // Debug represents debug-level messages.
    Debug Priority = 7
)
const (
    // Kern represents kernel messages.
    Kern Priority = (0 * 8)

    // User represents user-level messages.
    User Priority = (1 * 8)

    // Mail represents mail system messages.
    Mail Priority = (2 * 8)

    // Daemon represents system daemons' messages.
    Daemon Priority = (3 * 8)

    // Auth represents authorization messages.
    Auth Priority = (4 * 8)

    // Syslog represents messages generated internally by syslogd.
    Syslog Priority = (5 * 8)

    // Lpr represents line printer subsystem messages.
    Lpr Priority = (6 * 8)

    // News represents network news subsystem messages.
    News Priority = (7 * 8)

    // Uucp represents UUCP subsystem messages.
    Uucp Priority = (8 * 8)

    // Cron represents clock daemon messages.
    Cron Priority = (9 * 8)

    // Authpriv represents security/authorization messages.
    Authpriv Priority = (10 * 8)

    // Ftp represents ftp daemon messages.
    Ftp Priority = (11 * 8)

    // Ntp represents NTP subsystem messages.
    Ntp Priority = (12 * 8)

    // Audit represents audit messages.
    Audit Priority = (13 * 8)

    // Console represents console messages.
    Console Priority = (14 * 8)

    // Cron2 represents clock daemon messages.
    Cron2 Priority = (15 * 8)

    // Local0 represents messages designated as local use 0.
    Local0 Priority = (16 * 8)

    // Local1 represents messages designated as local use 1.
    Local1 Priority = (17 * 8)

    // Local2 represents messages designated as local use 2.
    Local2 Priority = (18 * 8)

    // Local3 represents messages designated as local use 3.
    Local3 Priority = (19 * 8)

    // Local4 represents messages designated as local use 4.
    Local4 Priority = (20 * 8)

    // Local5 represents messages designated as local use 5.
    Local5 Priority = (21 * 8)

    // Local6 represents messages designated as local use 6.
    Local6 Priority = (22 * 8)

    // Local7 represents messages designated as local use 7.
    Local7 Priority = (23 * 8)

    // InvalidFacility is a standard error that indicates that the log
    // facility component of a Priority does not represent a legitimate log
    // facility.
    InvalidFacility = errors.New(
        "The facility portion of a pri.Priority can only have one of" +
            " the 24 values from pri.Kern through pri.Local7." +
            " The acceptable values are described at length by" +
            " both RFC3164 and RFC5424, and these constants are" +
            " listed at:" +
            " https://godoc.org/github.com/proidiot/gone/log/pri",
    )
)

func GetFromEnv Uses

func GetFromEnv() Priority

GetFromEnv gives the Priority indicated by environment variables (or else the default Priority). This Priority will only include the log facility component as log severity is always set when logs are created.

func (Priority) Facility Uses

func (p Priority) Facility() Priority

Facility gives the log facility component of a Priority.

func (Priority) Severity Uses

func (p Priority) Severity() Priority

Severity gives the log severity component of a Priority.

func (Priority) String Uses

func (p Priority) String() string

String creates a string representation of the Priority.

func (Priority) ValidFacility Uses

func (p Priority) ValidFacility() error

ValidFacility indicates whether the facility component of a Priority represents a legitimate log facility.

Package pri imports 3 packages (graph) and is imported by 3 packages. Updated 2018-02-07. Refresh now. Tools for package owners.