Documentation ¶
Index ¶
- Variables
- type Logger
- func NewFromKitLogger(l log.Logger) Logger
- func NewJSONLogger() Logger
- func NewLogfmtLogger() Logger
- func With(l log.Logger, keyvals ...interface{}) Logger
- func WithContext(ctx context.Context, logger log.Logger) Logger
- func WithLevel(l log.Logger, levelStr string) Logger
- func WithRequest(req *http.Request, l log.Logger) Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCaller = log.Caller(4)
DefaultCaller is an alternative to the go-kit object of the same name to account for wrapping
View Source
var DefaultTimestampUTC = log.DefaultTimestampUTC
DefaultTimestampUTC is a passthrough to the go-kit object of the same name
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Log(keyvals ...interface{}) error Message(string, ...interface{}) Err(string, error, ...interface{}) Printf(string, ...interface{}) }
Logger is the extended logging interface for the corvee applications
func NewFromKitLogger ¶
NewFromKitLogger wraps a go-kit logger in our custom extension
func NewJSONLogger ¶
func NewJSONLogger() Logger
NewJSONLogger creates a new logger that writes json to stdout
func NewLogfmtLogger ¶
func NewLogfmtLogger() Logger
NewLogfmtLogger creates a new logger that writes logfmt to stdout
func WithContext ¶
WithContext wraps a logger to include the request_id from a context in log messages
Click to show internal directories.
Click to hide internal directories.