Documentation
¶
Index ¶
- type Config
- type ElasticLogger
- type HTTPLogger
- type L
- func (l *L) Debug(msg interface{}, keyvals ...interface{}) error
- func (l *L) Err(msg interface{}, keyvals ...interface{}) error
- func (l *L) Fatal(msg interface{}, keyvals ...interface{})
- func (l *L) Info(msg interface{}, keyvals ...interface{}) error
- func (l *L) New(name string) *L
- func (l *L) Warn(msg interface{}, keyvals ...interface{}) error
- func (l *L) With(keyvals ...interface{}) *L
- type Level
- type NSQLogger
- type StripeLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is used to parse CLI flags related to logging
type ElasticLogger ¶
type ElasticLogger struct {
// contains filtered or unexported fields
}
ElasticLogger wraps a L and satisfies the interface required by https://godoc.org/github.com/olivere/elastic#Logger
func NewElasticLogger ¶
func NewElasticLogger(l *L) *ElasticLogger
NewElasticLogger creates a new ElasticSearch compatible logger that wraps l
func (*ElasticLogger) Printf ¶
func (el *ElasticLogger) Printf(format string, v ...interface{})
Printf logs the message to the wrapped logger at the debug level
type HTTPLogger ¶
type HTTPLogger struct {
// contains filtered or unexported fields
}
HTTPLogger wraps a L and satisfys the interface required by https://godoc.org/github.com/ernesto-jimenez/httplogger#HTTPLogger
func NewHTTPLogger ¶
func NewHTTPLogger(l *L, level string) *HTTPLogger
NewHTTPLogger creates a new HTTPLogger. level is the log level at which you want your HTTP requests logged at.
func (*HTTPLogger) LogRequest ¶
func (h *HTTPLogger) LogRequest(*http.Request)
LogRequest doesn't do anything since we'll be logging replies only
func (*HTTPLogger) LogResponse ¶
func (h *HTTPLogger) LogResponse(req *http.Request, res *http.Response, err error, duration time.Duration)
LogResponse logs path, host, status code and duration in milliseconds
type L ¶
type L struct {
Level Level
// contains filtered or unexported fields
}
L is the logger implementation
func Silence ¶
func Silence() *L
Silence returns a logger that writes everything to /dev/null. Useful for silencing log output from tests
func (*L) Fatal ¶
func (l *L) Fatal(msg interface{}, keyvals ...interface{})
Fatal logs a message at the fatal level and also exits the program by calling os.Exit
type NSQLogger ¶
type NSQLogger struct {
// contains filtered or unexported fields
}
NSQLogger is a thin wrapper around our the Logger that bends it to the interface uses by the go-nsq library
func NewNSQLogger ¶
NewNSQLogger initializes a new Logger
type StripeLogger ¶
type StripeLogger struct {
// contains filtered or unexported fields
}
StripeLogger is a thin wrapper around our the Logger that bends it to the interface uses by the stripe library
func NewStripeLogger ¶
func NewStripeLogger(l *L, level string) *StripeLogger
NewStripeLogger initializes a new Logger
func (*StripeLogger) Printf ¶
func (l *StripeLogger) Printf(format string, v ...interface{})
Printf prints a message to the logs