Documentation ¶
Overview ¶
Package log providers a simple logging implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { Debug state Info state Warn state Error state // contains filtered or unexported fields }
Logger is the type for logging information at different levels of severity. The Logger has three states representing each level that can be logged at, Debug, Info, and Error.
func New ¶
func New(wc io.WriteCloser) *Logger
New returns a new Logger that will write to the given io.Writer. This will use the stdlib's logger with the log.Ldate, log.Ltime, and log.LUTC flags set. The default level of the returned Logger is info.
func (*Logger) SetLevel ¶
SetLevel sets the level of the logger. The level should be either "debug", "info", or "error". If the given string is none of these values then the logger's level will be unchanged.
func (*Logger) SetWriter ¶
func (l *Logger) SetWriter(w io.WriteCloser)
SetWriter set's the io.Writer for the underlying logger.