Documentation ¶
Overview ¶
Package log provides a level based logger in place of go's standard logger
Index ¶
- Constants
- type Logger
- func (l *Logger) Clone() *Logger
- func (l *Logger) Crit(args ...interface{})
- func (l *Logger) Critf(format string, args ...interface{})
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Flags() int
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) MinLevel() int
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Prefix() string
- func (l *Logger) SetFlags(flags int) *Logger
- func (l *Logger) SetPrefix(prefix string) *Logger
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(format string, args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
Constants ¶
const ( FTimestamp = 1 << iota FShowFile // Maybe some other time. )
Log flags
const ( TRACE = 10 * iota DEBUG INFO WARN ERROR CRIT PANIC )
Log levels
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a level based logging engine
func (*Logger) Clone ¶
Clone duplicates the logger it is run on, returning a clean version that can be modified
func (*Logger) Crit ¶
func (l *Logger) Crit(args ...interface{})
Crit logs the passed data at the Crit level. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Critf ¶
Critf logs the passed data at the Critf level using the format string passed as the first argument to format the message. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Debug ¶
func (l *Logger) Debug(args ...interface{})
Debug logs the passed data at the Debug level. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Debugf ¶
Debugf logs the passed data at the Debugf level using the format string passed as the first argument to format the message. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Info ¶
func (l *Logger) Info(args ...interface{})
Info logs the passed data at the Info level. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Infof ¶
Infof logs the passed data at the Infof level using the format string passed as the first argument to format the message. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Panic ¶
func (l *Logger) Panic(args ...interface{})
Panic logs the passed data at the Panic level. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Panicf ¶
Panicf logs the passed data at the Panicf level using the format string passed as the first argument to format the message. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) SetFlags ¶
SetFlags is a setter for the logger's flags. It returns the same Logger it was run on for use in call chains
func (*Logger) SetPrefix ¶
SetPrefix is a setter for the logger's flags. It returns the same Logger it was run on for use in call chains
func (*Logger) Trace ¶
func (l *Logger) Trace(args ...interface{})
Trace logs the passed data at the Trace level. The passed arguments are run through fmt.Sprintf before logging
func (*Logger) Tracef ¶
Tracef logs the passed data at the Tracef level using the format string passed as the first argument to format the message. The passed arguments are run through fmt.Sprintf before logging