Documentation
¶
Overview ¶
Package overlog provides a reference logging implementation for Scribe. Besides being a minimal logger, Overlog provides support for capturing site-specific metadata and logging from concurrent applications, preventing the interleaving of logs across goroutine calls. Overlog also supports logging of raw strings, bypassing the formatter.
Index ¶
Constants ¶
const ( // TimestampLayoutDateTime is a full layout containing both a date and a time portion. TimestampLayoutDateTime = "2006-01-02 15:04:05.000" // TimestampLayoutTimeOnly contains only the time. TimestampLayoutTimeOnly = "15:04:05.000" // TimestampLayoutDefault is the default layout applied in the formatter returned by Timestamp(). TimestampLayoutDefault = TimestampLayoutTimeOnly )
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append writes a string into the buffer. If the buffer is non-empty, a leading space is inserted before the string is written.
func Bind ¶
func Bind(logger Overlog) scribe.LoggerFactories
Bind creates a direct binding for the given logger.
Types ¶
type Formatter ¶
Formatter specifies how a logging event should be rendered in a given output buffer.
func StandardFormat ¶
func StandardFormat() Formatter
StandardFormat produces a formatter that includes all conventional elements — the timestamp, log level, message, and the scene contents.
type Overlog ¶
type Overlog interface {
With(level scribe.Level, scene scribe.Scene) scribe.Logger
Raw(str string)
Tracef(format string, args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Overlog is a synchronized logger backed by an io.Writer, suitable for use in concurrent applications where an unsynchronized logger would result in interleaved log entries.