Codebase list golang-github-hashicorp-go-syslog / 81b5d2eb-a645-47bc-b065-60c70dd4c771/main syslog.go
81b5d2eb-a645-47bc-b065-60c70dd4c771/main

Tree @81b5d2eb-a645-47bc-b065-60c70dd4c771/main (Download .tar.gz)

syslog.go @81b5d2eb-a645-47bc-b065-60c70dd4c771/mainraw · history · blame

package gsyslog

// Priority maps to the syslog priority levels
type Priority int

const (
	LOG_EMERG Priority = iota
	LOG_ALERT
	LOG_CRIT
	LOG_ERR
	LOG_WARNING
	LOG_NOTICE
	LOG_INFO
	LOG_DEBUG
)

// Syslogger interface is used to write log messages to syslog
type Syslogger interface {
	// WriteLevel is used to write a message at a given level
	WriteLevel(Priority, []byte) error

	// Write is used to write a message at the default level
	Write([]byte) (int, error)

	// Close is used to close the connection to the logger
	Close() error
}