mask

package
v0.0.0-...-1151264 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mask

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

func GetFromEnv() Mask

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

func UpTo

func UpTo(p pri.Priority) Mask

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

func (Mask) Masked

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

func (m Mask) String() string

String creates a string representation of the Mask.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL