Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var LdJSONFormatter = func() { logging.SetFormatter(&PoliteJSONFormatter{}) }
LdJSONFormatter Option formats the event log as line-delimited JSON
var LevelDebug = func() { logging.SetLevel(logging.DEBUG, "") }
LevelDebug Option sets the log level to debug
var LevelError = func() { logging.SetLevel(logging.ERROR, "") }
LevelError Option sets the log level to error
var LevelInfo = func() { logging.SetLevel(logging.INFO, "") }
LevelInfo Option sets the log level to info
var MaxWriterBuffer = 512 * 1024
MaxWriterBuffer specifies how big the writer buffer can get before killing the writer.
var TextFormatter = func() { logging.SetFormatter(logging.DefaultFormatter) }
TextFormatter Option formats the event log as human-readable plain-text
var WriterGroup = NewMirrorWriter()
WriterGroup is the global writer group for logs to output to
Functions ¶
Types ¶
type MirrorWriter ¶
type MirrorWriter struct {
// contains filtered or unexported fields
}
MirrorWriter implements a WriteCloser which syncs incoming bytes to multiple [buffered] WriteClosers. They can be added with AddWriter().
func NewMirrorWriter ¶
func NewMirrorWriter() *MirrorWriter
NewMirrorWriter initializes and returns a MirrorWriter.
func (*MirrorWriter) Active ¶
func (mw *MirrorWriter) Active() (active bool)
Active returns if there is at least one Writer attached to this MirrorWriter
func (*MirrorWriter) AddWriter ¶
func (mw *MirrorWriter) AddWriter(w io.WriteCloser)
AddWriter attaches a new WriteCloser to this MirrorWriter. The new writer will start getting any bytes written to the mirror.
type PoliteJSONFormatter ¶
type PoliteJSONFormatter struct{}
PoliteJSONFormatter marshals entries into JSON encoded slices (without overwriting user-provided keys). How polite of it!