log

package
v0.0.0-...-bc9bb66 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogSeverityEmerg  LogSeverity = "emergency"
	LogSeverityAlert              = "alert"
	LogSeverityCrit               = "critical"
	LogSeverityErr                = "error"
	LogSeverityWarn               = "warning"
	LogSeverityNotice             = "notice"
	LogSeverityInfo               = "info"
	LogSeverityDebug              = "debug"
)
View Source
const (
	LogFacilityKern     LogFacility = "kern"
	LogFacilityUser                 = "user"
	LogFacilityMail                 = "mail"
	LogFacilityDaemon               = "daemon"
	LogFacilityAuth                 = "auth"
	LogFacilitySyslog               = "syslog"
	LogFacilityLPR                  = "lpr"
	LogFacilityNews                 = "news"
	LogFacilityUUCP                 = "uucp"
	LogFacilityCron                 = "cron"
	LogFacilityAuthPriv             = "authpriv"
	LogFacilityFTP                  = "ftp"
	LogFacilityLocal0               = "local0"
	LogFacilityLocal1               = "local1"
	LogFacilityLocal2               = "local2"
	LogFacilityLocal3               = "local3"
	LogFacilityLocal4               = "local4"
	LogFacilityLocal5               = "local5"
	LogFacilityLocal6               = "local6"
	LogFacilityLocal7               = "local7"
)

Variables

This section is empty.

Functions

func Alert

func Alert(s ...string) error

func Apply

func Apply(c LogConfig) error

func Close

func Close() error

func Crit

func Crit(s ...string) error

func Debug

func Debug(s ...string) error

func Emerg

func Emerg(s ...string) error

func Err

func Err(s ...string) error

func Info

func Info(s ...string) error

func Notice

func Notice(s ...string) error

func Warn

func Warn(s ...string) error

func Write

func Write(b []byte, s LogSeverity) error

func WriteString

func WriteString(s LogSeverity, m ...string) error

Types

type LogConfig

type LogConfig struct {
	Target        LogTarget   `xml:"target"`
	File          string      `xml:"file"`
	SyslogAddress string      `xml:"address"`
	SyslogTag     string      `xml:"tag"`
	Severity      LogSeverity `xml:"severity"`
	Facility      LogFacility `xml:"facility"`
}

func (LogConfig) Apply

func (c LogConfig) Apply() error

func (LogConfig) ParseSyslogAddress

func (c LogConfig) ParseSyslogAddress() (string, string, error)

type LogFacility

type LogFacility string

func (LogFacility) Priority

func (l LogFacility) Priority() syslog.Priority

type LogSeverity

type LogSeverity string

func (LogSeverity) Bigger

func (l LogSeverity) Bigger(r LogSeverity) bool

func (LogSeverity) BiggerOrEqual

func (l LogSeverity) BiggerOrEqual(r LogSeverity) bool

func (LogSeverity) Equal

func (l LogSeverity) Equal(r LogSeverity) bool

func (LogSeverity) Lower

func (l LogSeverity) Lower(r LogSeverity) bool

func (LogSeverity) LowerOrEqual

func (l LogSeverity) LowerOrEqual(r LogSeverity) bool

func (LogSeverity) Priority

func (l LogSeverity) Priority() syslog.Priority

type LogTarget

type LogTarget string
const LogTargetFile LogTarget = "file"
const LogTargetSyslog LogTarget = "syslog"

type Logger

type Logger interface {
	Close() error

	Emerg(s ...string) error
	Alert(s ...string) error
	Crit(s ...string) error
	Err(s ...string) error
	Warn(s ...string) error
	Notice(s ...string) error
	Info(s ...string) error
	Debug(s ...string) error

	Write(b []byte, s LogSeverity) error
	WriteString(s LogSeverity, m ...string) error
}

type LoggerNotAvailable

type LoggerNotAvailable struct{}

func (LoggerNotAvailable) Error

func (e LoggerNotAvailable) Error() string

Jump to

Keyboard shortcuts

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