Documentation
¶
Overview ¶
Package logger defines interfaces that logger drivers implement to log messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = Discard()
Default returns the default logger.
Functions ¶
Types ¶
type Dumper ¶
Dumper dumps the http.Request and http.Response message payload for debugging purposes.
func StandardDumper ¶
StandardDumper returns a standard dumper.
type Logger ¶
type Logger interface {
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Debugln(args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Errorln(args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Infoln(args ...interface{})
Trace(args ...interface{})
Tracef(format string, args ...interface{})
Traceln(args ...interface{})
Warn(args ...interface{})
Warnf(format string, args ...interface{})
Warnln(args ...interface{})
WithError(error) Logger
WithField(string, interface{}) Logger
}
A Logger represents an active logging object that generates lines of output to an io.Writer.
func FromContext ¶
FromContext retrieves the current logger from the context.
func FromRequest ¶
FromRequest retrieves the current logger from the request. If no logger is available, the default logger is returned.
Click to show internal directories.
Click to hide internal directories.