Documentation ¶
Index ¶
- Constants
- Variables
- type Helper
- func (h *Helper) Debug(keyvals ...interface{})
- func (h *Helper) Debugf(format string, a ...interface{})
- func (h *Helper) Error(keyvals ...interface{})
- func (h *Helper) Errorf(format string, a ...interface{})
- func (h *Helper) Fatal(keyvals ...interface{})
- func (h *Helper) Fatalf(format string, a ...interface{})
- func (h *Helper) Info(keyvals ...interface{})
- func (h *Helper) Infof(format string, a ...interface{})
- func (h *Helper) Log(level Level, keyvals ...interface{})
- func (h *Helper) Panic(keyvals ...interface{})
- func (h *Helper) Panicf(format string, a ...interface{})
- func (h *Helper) Warn(keyvals ...interface{})
- func (h *Helper) Warnf(format string, a ...interface{})
- func (h *Helper) WithContext(ctx context.Context) *Helper
- type Level
- type Logger
- type Option
- type Valuer
Constants ¶
View Source
const ( DefaultMessageKey = "msg" DefaultLevel = Info )
Variables ¶
View Source
var ( // DefaultCaller is a Valuer that returns the file and line where the Log method was invoked. It can only be used with log.With. DefaultCaller = Caller(3) )
View Source
var ( // ErrMissingValue is appended to keyvalues slices with odd length to substitute the missing value. ErrMissingValue = errors.New("(missing value)") )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Log(level Level, keyvals ...interface{})
}
Logger is the fundamental interface for all log operations. Log creates a log event from keyvals, a variadic sequence of alternating keys and values. Implementations must be safe for concurrent use by multiple goroutines. In particular, any implementation of Logger that appends to keyvals or modifies or retains any of its elements must make a copy first.
func NewStdLogger ¶
NewStdLogger new a logger implements Logger interface
Click to show internal directories.
Click to hide internal directories.