Documentation
¶
Index ¶
- type CtxLogger
- func (l *CtxLogger) Debug(ctx context.Context, msg string, args ...interface{})
- func (l *CtxLogger) Error(ctx context.Context, msg string, args ...interface{})
- func (l *CtxLogger) Fatal(ctx context.Context, msg string, args ...interface{})
- func (l *CtxLogger) Info(ctx context.Context, msg string, args ...interface{})
- func (l *CtxLogger) Level() string
- func (l *CtxLogger) Warn(ctx context.Context, msg string, args ...interface{})
- func (l *CtxLogger) Writer() io.Writer
- type Logger
- type Noop
- func (n *Noop) Debug(ctx context.Context, msg string, args ...interface{})
- func (n *Noop) Error(ctx context.Context, msg string, args ...interface{})
- func (n *Noop) Fatal(ctx context.Context, msg string, args ...interface{})
- func (n *Noop) Info(ctx context.Context, msg string, args ...interface{})
- func (n *Noop) Level() string
- func (n *Noop) Warn(ctx context.Context, msg string, args ...interface{})
- func (n *Noop) Writer() io.Writer
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CtxLogger ¶
type CtxLogger struct {
// contains filtered or unexported fields
}
func NewCtxLogger ¶
NewCtxLogger returns a logger that will add context value to the log message
func NewCtxLoggerWithSaltLogger ¶
NewCtxLoggerWithSaltLogger returns a logger that will add context value to the log message, wrapped with saltLog.Logger
type Logger ¶
type Logger interface {
// Debug level message with alternating key/value pairs
// key should be string, value could be anything printable
Debug(ctx context.Context, msg string, args ...interface{})
// Info level message with alternating key/value pairs
// key should be string, value could be anything printable
Info(ctx context.Context, msg string, args ...interface{})
// Warn level message with alternating key/value pairs
// key should be string, value could be anything printable
Warn(ctx context.Context, msg string, args ...interface{})
// Error level message with alternating key/value pairs
// key should be string, value could be anything printable
Error(ctx context.Context, msg string, args ...interface{})
// Fatal level message with alternating key/value pairs
// key should be string, value could be anything printable
Fatal(ctx context.Context, msg string, args ...interface{})
// Level returns priority level for which this logger will filter logs
Level() string
// Writer used to print logs
Writer() io.Writer
}
Click to show internal directories.
Click to hide internal directories.