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

package syslogger

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

Index

Package Files

delay.go fallthrough.go humanreadable.go mockable.go multi.go native.go newliner.go nowait.go posixish.go rfc3164.go severitymask.go syslogger.go writer.go

type Delay Uses

type Delay struct {
    // contains filtered or unexported fields
}

Delay is a syslogger.Syslogger that delays the initialization of another syslogger.Syslogger until the first time that Syslog is called.

func NewDelay Uses

func NewDelay(cb func() (Syslogger, error)) (*Delay, error)

NewDelay gives a Delay syslogger.Syslogger given the callback function which will ultimately be used to create the real syslogger.Syslogger to be used.

func (*Delay) Syslog Uses

func (d *Delay) Syslog(p pri.Priority, msg interface{}) error

Syslog logs messages. In the case of Delay, these messages are passed unaltered to another syslogger.Syslogger, and that syslogger.Syslogger would be created at this point if it had not already existed.

type Fallthrough Uses

type Fallthrough struct {
    Default     Syslogger
    Fallthrough Syslogger
}

Fallthrough is a syslogger.Syslogger that logs to a backup syslogger.Sylogger in the event that there is trouble logging to the default syslogger.Syslogger.

func (*Fallthrough) Syslog Uses

func (f *Fallthrough) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of a Fallthrough, an attempt will be made to log to a default syslogger.Syslogger, then if that fails an attempt will be made to log to a fallthrough syslogger.Sylogger, then if that fails an error is returned.

type HumanReadable Uses

type HumanReadable struct {
    Syslogger Syslogger
    Ident     string
    Facility  pri.Priority
    Pid       bool
}

HumanReadable is a syslogger.Syslogger that will format the message in a human readable way before passing the modified message to another syslogger.Syslogger.

func (*HumanReadable) Syslog Uses

func (h *HumanReadable) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of HumanReadable, the message will be given a specific format and then forwarded to another syslogger.Syslogger.

type Multi Uses

type Multi struct {
    Sysloggers []Syslogger
    TryAll     bool
}

Multi is a syslogger.Syslogger that will send messages to all of several other syslogger.Sysloggers.

func (*Multi) Syslog Uses

func (m *Multi) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of Multi, the message will be sent to each of several other syslogger.Sysloggers assuming none of the syslogger.Sysloggers produce an error.

type NativeSyslog Uses

type NativeSyslog struct {
    // contains filtered or unexported fields
}

NativeSyslog is a syslogger.Syslogger that is a lightweight wrapper around golang's native log/syslog.Writer.

func DialNativeSyslog Uses

func DialNativeSyslog(
    network string,
    raddr string,
    f pri.Priority,
    ident string,
) (*NativeSyslog, error)

DialNativeSyslog creates a new NativeSyslog based on using log/syslog.Dial.

func NewNativeSyslog Uses

func NewNativeSyslog(f pri.Priority, ident string) (*NativeSyslog, error)

NewNativeSyslog creates a new NativeSyslog based on the given log facility and identity string.

func (*NativeSyslog) Close Uses

func (n *NativeSyslog) Close() error

Close closes a native log/syslog.Writer.

func (*NativeSyslog) Syslog Uses

func (n *NativeSyslog) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of NativeSyslog, the message is sent to golang's log/syslog.Writer.

type Newliner Uses

type Newliner struct {
    Syslogger Syslogger
}

Newliner is a syslogger.Syslogger that assures the last byte in a message is a newline (i.e. a literal byte 0x0A).

func (*Newliner) Syslog Uses

func (n *Newliner) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of Newliner, the message has a newline added if not already present before passing through to another Syslogger.

type NoWait Uses

type NoWait struct {
    Syslogger Syslogger
}

NoWait is a syslogger.Syslogger that allows calls to Syslog to return immediately.

func (*NoWait) Syslog Uses

func (n *NoWait) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of NoWait, the message will be sent to another syslogger.Syslogger asynchronously.

type Posixish Uses

type Posixish struct {
    // contains filtered or unexported fields
}

Posixish is a syslogger.Syslogger that behaves much like the syslog system specified in POSIX.

func (*Posixish) Close Uses

func (px *Posixish) Close() error

Close closes a Posixish, which has basically no effect other than to reset all the file descriptors.

func (*Posixish) Closelog Uses

func (px *Posixish) Closelog() error

Closelog closes a Posixish, which has basically no effect other than to reset all the file descriptors.

func (*Posixish) Openlog Uses

func (px *Posixish) Openlog(
    ident string,
    options opt.Option,
    facility pri.Priority,
) error

Openlog re-initializes the Posixish based on the given opt.Option, overriding any previous values.

func (*Posixish) SetLogMask Uses

func (px *Posixish) SetLogMask(m mask.Mask) error

SetLogMask sets the Posixish's log mask.Mask.

func (*Posixish) Syslog Uses

func (px *Posixish) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. How this message is routed depends on what settings were given to Openlog (and potentially a log mask).

type Rfc3164 Uses

type Rfc3164 struct {
    Syslogger Syslogger
    Ident     string
    Facility  pri.Priority
    Pid       bool
}

Rfc3164 is a syslogger.Syslogger that will format the message in a way that is intended to be compliant with RFC 3164 before passing the modified message to another syslogger.Syslogger.

func (*Rfc3164) Syslog Uses

func (r *Rfc3164) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of Rfc3164, the message is will be given a specific format and then forwarded to another syslogger.Syslogger.

type SeverityMask Uses

type SeverityMask struct {
    Syslogger Syslogger
    Mask      mask.Mask
}

SeverityMask is a syslogger.Syslogger that only forwards messages that aren't masked to another syslogger.Syslogger.

func (*SeverityMask) Syslog Uses

func (s *SeverityMask) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of SeverityMask, the message is sent to another syslogger.Syslogger if and only if the message isn't masked.

type Syslogger Uses

type Syslogger interface {
    Syslog(p pri.Priority, msg interface{}) error
}

Syslogger allows log messages to be recorded (or forwarded to another Syslogger) in some way.

type Writer Uses

type Writer struct {
    Writer io.Writer
}

Writer is a syslogger.Syslogger that writes messages directly to an io.Writer.

func (*Writer) Syslog Uses

func (w *Writer) Syslog(p pri.Priority, msg interface{}) error

Syslog logs a message. In the case of Writer, the message is written directly to an arbitrary io.Writer.

Package syslogger imports 11 packages (graph) and is imported by 1 packages. Updated 2018-01-01. Refresh now. Tools for package owners.