Documentation ¶
Overview ¶
Package loglevel aims to be the simplest and best-tested levelled logging wrapper around go's standard library log module. It retains as much of the same API as possible.
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Flags() int
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func Priority() int
- func SetFlags(flags int)
- func SetOutput(out io.Writer)
- func SetPrefix(prefix string)
- func SetPriority(priority int)
- func SetPriorityString(s string) error
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Traceln(v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Logger
- func (me *Logger) Debug(v ...interface{})
- func (me *Logger) Debugf(format string, v ...interface{})
- func (me *Logger) Debugln(v ...interface{})
- func (me *Logger) Error(v ...interface{})
- func (me *Logger) Errorf(format string, v ...interface{})
- func (me *Logger) Errorln(v ...interface{})
- func (me *Logger) Fatal(v ...interface{})
- func (me *Logger) Fatalf(format string, v ...interface{})
- func (me *Logger) Fatalln(v ...interface{})
- func (me *Logger) Flags() int
- func (me *Logger) Info(v ...interface{})
- func (me *Logger) Infof(format string, v ...interface{})
- func (me *Logger) Infoln(v ...interface{})
- func (me *Logger) Panic(v ...interface{})
- func (me *Logger) Panicf(format string, v ...interface{})
- func (me *Logger) Panicln(v ...interface{})
- func (me *Logger) Prefix() string
- func (me *Logger) Priority() int
- func (me *Logger) SetFlags(layouts int)
- func (me *Logger) SetPrefix(prefix string)
- func (me *Logger) SetPriority(priority int)
- func (me *Logger) SetPriorityString(s string) error
- func (me *Logger) Trace(v ...interface{})
- func (me *Logger) Tracef(format string, v ...interface{})
- func (me *Logger) Traceln(v ...interface{})
- func (me *Logger) Warn(v ...interface{})
- func (me *Logger) Warnf(format string, v ...interface{})
- func (me *Logger) Warnln(v ...interface{})
Constants ¶
const ( Poff = iota Pfatal Perror Pwarn Pinfo Pdebug Ptrace Pall )
Priority used for identifying the severity of an event.
const ( Ldate = 1 << iota // the date: 2012/01/23 Ltime // the time: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile Lpriority // the priority: Debug LstdFlags = Ldate | Ltime // initial values for the standard logger )
Flags used for identifying the format of an event. They are or'ed together to control what's printed. There is no control over the order they appear (the order listed here) or the format they present (as described in the comments). A colon appears after these items:
2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf prints to the standard logger with the Debug level.
func Debugln ¶
func Debugln(v ...interface{})
Debugln prints to the standard logger with the Debug level.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf prints to the standard logger with the Error level.
func Errorln ¶
func Errorln(v ...interface{})
Errorln prints to the standard logger with the Error level.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf prints the message it's given and quits the program
func Fatalln ¶
func Fatalln(v ...interface{})
Fatalln prints the message it's given and quits the program
func Infof ¶
func Infof(format string, v ...interface{})
Infof prints to the standard logger with the Info level.
func Infoln ¶
func Infoln(v ...interface{})
Infoln prints to the standard logger with the Info level.
func Panic ¶
func Panic(v ...interface{})
Panic prints the message it's given and panic()s the program
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf prints the message it's given and panic()s the program
func Panicln ¶
func Panicln(v ...interface{})
Panicln prints the message it's given and panic()s the program
func SetPriority ¶
func SetPriority(priority int)
SetPriority sets the output priority for the standard logger.
func SetPriorityString ¶
SetPriorityString sets the output priority by the name of a debug level
func Tracef ¶
func Tracef(format string, v ...interface{})
Tracef prints to the standard logger with the Trace level.
func Traceln ¶
func Traceln(v ...interface{})
Traceln prints to the standard logger with the Trace level.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger defines our wrapper around the system logger
func (*Logger) Debug ¶
func (me *Logger) Debug(v ...interface{})
Debug prints to the standard logger with the Debug level.
func (*Logger) Debugln ¶
func (me *Logger) Debugln(v ...interface{})
Debugln prints to the standard logger with the Debug level.
func (*Logger) Error ¶
func (me *Logger) Error(v ...interface{})
Error prints to the standard logger with the Error level.
func (*Logger) Errorln ¶
func (me *Logger) Errorln(v ...interface{})
Errorln prints to the standard logger with the Error level.
func (*Logger) Fatal ¶
func (me *Logger) Fatal(v ...interface{})
Fatal prints the message it's given and quits the program
func (*Logger) Fatalln ¶
func (me *Logger) Fatalln(v ...interface{})
Fatalln prints the message it's given and quits the program
func (*Logger) Info ¶
func (me *Logger) Info(v ...interface{})
Info prints to the standard logger with the Info level.
func (*Logger) Infoln ¶
func (me *Logger) Infoln(v ...interface{})
Infoln prints to the standard logger with the Info level.
func (*Logger) Panic ¶
func (me *Logger) Panic(v ...interface{})
Panic prints the message it's given and panic()s the program
func (*Logger) Panicln ¶
func (me *Logger) Panicln(v ...interface{})
Panicln prints the message it's given and panic()s the program
func (*Logger) SetPriority ¶
SetPriority sets the output priority for the logger.
func (*Logger) SetPriorityString ¶
SetPriorityString sets the output priority by the name of a debug level
func (*Logger) Trace ¶
func (me *Logger) Trace(v ...interface{})
Trace prints to the standard logger with the Trace level.
func (*Logger) Traceln ¶
func (me *Logger) Traceln(v ...interface{})
Traceln prints to the standard logger with the Trace level.
func (*Logger) Warn ¶
func (me *Logger) Warn(v ...interface{})
Warn prints to the standard logger with the Warn level.