Versions in this module Expand all Collapse all v2 v2.9.3 Mar 12, 2021 v2.9.2 Mar 12, 2021 Changes in this version + func Debug(args ...interface{}) + func Debugf(template string, args ...interface{}) + func Error(args ...interface{}) + func Errorf(template string, args ...interface{}) + func Fatal(args ...interface{}) + func Fatalf(template string, args ...interface{}) + func Info(args ...interface{}) + func Infof(template string, args ...interface{}) + func Init(opts ...Option) error + func Log(level Level, v ...interface{}) + func Logf(level Level, format string, v ...interface{}) + func NewContext(ctx context.Context, l Logger) context.Context + func String() string + func Trace(args ...interface{}) + func Tracef(template string, args ...interface{}) + func V(lvl Level, log Logger) bool + func Warn(args ...interface{}) + func Warnf(template string, args ...interface{}) + type Helper struct + func NewHelper(log Logger) *Helper + func (h *Helper) Debug(args ...interface{}) + func (h *Helper) Debugf(template string, args ...interface{}) + func (h *Helper) Error(args ...interface{}) + func (h *Helper) Errorf(template string, args ...interface{}) + func (h *Helper) Fatal(args ...interface{}) + func (h *Helper) Fatalf(template string, args ...interface{}) + func (h *Helper) Info(args ...interface{}) + func (h *Helper) Infof(template string, args ...interface{}) + func (h *Helper) Trace(args ...interface{}) + func (h *Helper) Tracef(template string, args ...interface{}) + func (h *Helper) Warn(args ...interface{}) + func (h *Helper) Warnf(template string, args ...interface{}) + func (h *Helper) WithError(err error) *Helper + func (h *Helper) WithFields(fields map[string]interface{}) *Helper + type Level int8 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const TraceLevel + const WarnLevel + func GetLevel(levelStr string) (Level, error) + func (l Level) Enabled(lvl Level) bool + func (l Level) String() string + type Logger interface + Fields func(fields map[string]interface{}) Logger + Init func(options ...Option) error + Log func(level Level, v ...interface{}) + Logf func(level Level, format string, v ...interface{}) + Options func() Options + String func() string + var DefaultLogger Logger = NewHelper(NewLogger()) + func Fields(fields map[string]interface{}) Logger + func FromContext(ctx context.Context) (Logger, bool) + func NewLogger(opts ...Option) Logger + type Option func(*Options) + func SetOption(k, v interface{}) Option + func WithCallerSkipCount(c int) Option + func WithFields(fields map[string]interface{}) Option + func WithLevel(level Level) Option + func WithOutput(out io.Writer) Option + type Options struct + CallerSkipCount int + Context context.Context + Fields map[string]interface{} + Level Level + Out io.Writer