go/src/log/syslog/syslog.go

type Priority

const severityMask

const facilityMask

const LOG_EMERG

const LOG_ALERT

const LOG_CRIT

const LOG_ERR

const LOG_WARNING

const LOG_NOTICE

const LOG_INFO

const LOG_DEBUG

const LOG_KERN

const LOG_USER

const LOG_MAIL

const LOG_DAEMON

const LOG_AUTH

const LOG_SYSLOG

const LOG_LPR

const LOG_NEWS

const LOG_UUCP

const LOG_CRON

const LOG_AUTHPRIV

const LOG_FTP

const _

const _

const _

const _

const LOG_LOCAL0

const LOG_LOCAL1

const LOG_LOCAL2

const LOG_LOCAL3

const LOG_LOCAL4

const LOG_LOCAL5

const LOG_LOCAL6

const LOG_LOCAL7

type Writer

type serverConn

type netConn

// New establishes a new connection to the system log daemon. Each
// write to the returned writer sends a log message with the given
// priority (a combination of the syslog facility and severity) and
// prefix tag. If tag is empty, the [os.Args][0] is used.
func New(priority Priority, tag string) (*Writer, error) {}

// Dial establishes a connection to a log daemon by connecting to
// address raddr on the specified network. Each write to the returned
// writer sends a log message with the facility and severity
// (from priority) and tag. If tag is empty, the [os.Args][0] is used.
// If network is empty, Dial will connect to the local syslog server.
// Otherwise, see the documentation for net.Dial for valid values
// of network and raddr.
func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) {}

// connect makes a connection to the syslog server.
// It must be called with w.mu held.
func (w *Writer) connect() (err error) {}

// Write sends a log message to the syslog daemon.
func (w *Writer) Write(b []byte) (int, error) {}

// Close closes a connection to the syslog daemon.
func (w *Writer) Close() error {}

// Emerg logs a message with severity [LOG_EMERG], ignoring the severity
// passed to New.
func (w *Writer) Emerg(m string) error {}

// Alert logs a message with severity [LOG_ALERT], ignoring the severity
// passed to New.
func (w *Writer) Alert(m string) error {}

// Crit logs a message with severity [LOG_CRIT], ignoring the severity
// passed to New.
func (w *Writer) Crit(m string) error {}

// Err logs a message with severity [LOG_ERR], ignoring the severity
// passed to New.
func (w *Writer) Err(m string) error {}

// Warning logs a message with severity [LOG_WARNING], ignoring the
// severity passed to New.
func (w *Writer) Warning(m string) error {}

// Notice logs a message with severity [LOG_NOTICE], ignoring the
// severity passed to New.
func (w *Writer) Notice(m string) error {}

// Info logs a message with severity [LOG_INFO], ignoring the severity
// passed to New.
func (w *Writer) Info(m string) error {}

// Debug logs a message with severity [LOG_DEBUG], ignoring the severity
// passed to New.
func (w *Writer) Debug(m string) error {}

func (w *Writer) writeAndRetry(p Priority, s string) (int, error) {}

// write generates and writes a syslog formatted string. The
// format is as follows: <PRI>TIMESTAMP HOSTNAME TAG[PID]: MSG
func (w *Writer) write(p Priority, msg string) (int, error) {}

func (n *netConn) writeString(p Priority, hostname, tag, msg, nl string) error {}

func (n *netConn) close() error {}

// NewLogger creates a [log.Logger] whose output is written to the
// system log service with the specified priority, a combination of
// the syslog facility and severity. The logFlag argument is the flag
// set passed through to [log.New] to create the Logger.
func NewLogger(p Priority, logFlag int) (*log.Logger, error) {}