Documentation
¶
Index ¶
- Constants
- Variables
- func Value(ctx context.Context, v interface{}) interface{}
- type Helper
- func (h *Helper) Debug(a ...interface{})
- func (h *Helper) Debugf(format string, a ...interface{})
- func (h *Helper) Debugw(keyvals ...interface{})
- func (h *Helper) Error(a ...interface{})
- func (h *Helper) Errorf(format string, a ...interface{})
- func (h *Helper) Errorw(keyvals ...interface{})
- func (h *Helper) Info(a ...interface{})
- func (h *Helper) Infof(format string, a ...interface{})
- func (h *Helper) Infow(keyvals ...interface{})
- func (h *Helper) Log(level Level, keyvals ...interface{})
- func (h *Helper) Warn(a ...interface{})
- func (h *Helper) Warnf(format string, a ...interface{})
- func (h *Helper) Warnw(keyvals ...interface{})
- func (h *Helper) WithContext(ctx context.Context) *Helper
- type Level
- type Logger
- type Valuer
Constants ¶
View Source
const LevelKey = "level"
LevelKey is logger level key.
Variables ¶
View Source
var ( // DefaultCaller is a Valuer that returns the file and line. DefaultCaller = Caller(3) // DefaultTimestamp is a Valuer that returns the current wallclock time. DefaultTimestamp = Timestamp(time.RFC3339) )
Functions ¶
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper is a logger helper.
func (*Helper) Debug ¶
func (h *Helper) Debug(a ...interface{})
Debug logs a message at debug level.
func (*Helper) Debugw ¶
func (h *Helper) Debugw(keyvals ...interface{})
Debugw logs a message at debug level.
func (*Helper) Error ¶
func (h *Helper) Error(a ...interface{})
Error logs a message at error level.
func (*Helper) Errorw ¶
func (h *Helper) Errorw(keyvals ...interface{})
Errorw logs a message at error level.
func (*Helper) Infow ¶
func (h *Helper) Infow(keyvals ...interface{})
Infow logs a message at info level.
type Level ¶
type Level int8
Level is a logger level.
func ParseLevel ¶
ParseLevel parses a level string into a logger Level value.
type Logger ¶
Logger is a logger interface.
var ( // DefaultLogger is default logger. DefaultLogger Logger = NewStdLogger(log.Writer()) )
Click to show internal directories.
Click to hide internal directories.