Documentation
¶
Overview ¶
Package log provides interfaces, basic types and formatting helpers for common application logging tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConsoleLogger = &ConsoleLog{}
var NullLogger = &NullLog{}
Functions ¶
This section is empty.
Types ¶
type ConsoleLog ¶
type ConsoleLog struct{}
func (*ConsoleLog) Debug ¶
func (nl *ConsoleLog) Debug(format string, v ...interface{})
func (*ConsoleLog) Error ¶
func (nl *ConsoleLog) Error(format string, v ...interface{})
func (*ConsoleLog) Info ¶
func (nl *ConsoleLog) Info(format string, v ...interface{})
func (*ConsoleLog) Print ¶
func (nl *ConsoleLog) Print(msg *LogMsg)
type DebugLogger ¶
type DebugLogger interface {
Debug(format string, v ...interface{})
}
type ErrorLogger ¶
type ErrorLogger interface {
Error(format string, v ...interface{})
}
type InfoLogger ¶
type InfoLogger interface {
Info(format string, v ...interface{})
}
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer holds a specified number of logs in memory for rendering by the http logs Uri.
func NewLogBuffer ¶
NewLogBuffer returns a pointer to a new LogBuffer instance.
func (*LogBuffer) HasChanged ¶
HasChanged reports whether or not the buffer has been modified since it was last read.
func (*LogBuffer) MarshalJSON ¶
MarshalJSON implements the standard go json marshaler for the LogBuffer type.
func (*LogBuffer) Print ¶
Print formats and adds a new message to the log buffer. If the new message causes the log buffer to grow larger than its maxSize, it truncates the end oldest entry in the buffer. Once the message is stored, the changed flag is set to true.
func (*LogBuffer) SetEnabled ¶
SetEnabled temporarily enables/disables the logger.
type LogCloser ¶
type LogCloser interface {
Close()
}
LogCloser represents the interface for a closable log object, such as those provided by file-backed logging.
type LogMsg ¶
type LogNotify ¶
type LogNotify interface {
Print(msg *LogMsg)
}
Log represents the interface for a generalized log object.
type LogToggler ¶
type LogToggler interface {
SetEnabled(bool)
}
LogToggler represents the interface needed to temporarily enabled/disable a given logger.