log
v1.1.1
Documentation
pkg.go.dev ↗Package log providers a simple logging implementation.
Types
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.
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.
Logger.Close
func (l *Logger) Close() error
Logger.SetLevel
func (l *Logger) SetLevel(s string)
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.
Logger.SetWriter
func (l *Logger) SetWriter(w io.WriteCloser)
SetWriter set's the io.Writer for the underlying logger.
Queue
type Queue struct {
*Logger
}
Queue is a logger that can be given to CurlyQ for logging information about the jobs being processed.
Queue.Debug
func (q Queue) Debug(v ...interface{})
Queue.Error
func (q Queue) Error(v ...interface{})
Queue.Info
func (q Queue) Info(v ...interface{})
Queue.Warn
func (q Queue) Warn(v ...interface{})