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

package mask

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


Package Files


type Mask Uses

type Mask byte

Mask represents a log severity mask See POSIX.1-2008. Also see POSIX.1-2001, RFC 3164, and RFC 5424.

const (
    Emerg   Mask = (1 << pri.Emerg)
    Alert   Mask = (1 << pri.Alert)
    Crit    Mask = (1 << pri.Crit)
    Err     Mask = (1 << pri.Err)
    Warning Mask = (1 << pri.Warning)
    Notice  Mask = (1 << pri.Notice)
    Info    Mask = (1 << pri.Info)
    Debug   Mask = (1 << pri.Debug)

Masks which only allow messages matching the corresponding severity level to be processed. These values would be passed to SetLogMask.

func GetFromEnv Uses

func GetFromEnv() Mask

GetFromEnv gives the Mask indicated by environment variables (or else the default Mask).

func UpTo Uses

func UpTo(p pri.Priority) Mask

UpTo creates a Mask that unmasks all log priorities up the given pri.Priority.

func (Mask) Masked Uses

func (m Mask) Masked(p pri.Priority) bool

Masked indicates whether a log message with the given pri.Priority should be masked (i.e. hidden) by this Mask.

func (Mask) String Uses

func (m Mask) String() string

String creates a string representation of the Mask.

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