Documentation ¶
Overview ¶
Provides a simple log wrapper with up to 5 Loglevels and multiple outputs.
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Flags() int
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Outputs() []io.Writer
- func Prefix() string
- func SetFlags(f int)
- func SetLevel(newLevel Loglevel) error
- func SetOutputs(out []io.Writer) error
- func SetPrefix(p string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Loglevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Prints a formatted debug message to all outputs if Level == DEBUG.
func Errorf ¶
func Errorf(format string, v ...interface{})
Prints a formatted error to all outputs if Level >= ERROR.
func Fatal ¶
func Fatal(v ...interface{})
Prints an error to all outputs and exits afterwards with Code 1.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Prints a formatted error to all outputs and exits afterwards with Code 1.
func Infof ¶
func Infof(format string, v ...interface{})
Prints a formatted informal message to all outputs if Level >= INFO.
func SetLevel ¶
Sets the Loglevel to one of FATAL, ERROR, WARN, INFO or DEBUG. Returns "Loglevel out of range" if too small or big.
func SetOutputs ¶
Assigns every writer given via out a new Logger. Returns "No outputs given" if out is empty.
Types ¶
type Loglevel ¶
type Loglevel int
func ParseLevel ¶
Transposes string loglvl to corresponding Loglevel. Returns error if string does not match.