Documentation ¶
Index ¶
- Variables
- func FromCtx(ctx context.Context) []any
- func GetVer() string
- func ParseFlag(level string) error
- func SetVer(v string)
- func WithCtx(ctx context.Context, keysAndValues ...any) context.Context
- type Log
- func (l *Log) Debugw(ctx context.Context, msg string, keysAndValues ...interface{})
- func (l *Log) Errorw(ctx context.Context, err error, msg string, keysAndValues ...interface{}) error
- func (l *Log) Infof(ctx context.Context, msg string, args ...interface{})
- func (l *Log) Infow(ctx context.Context, msg string, keysAndValues ...interface{})
- func (l *Log) Named(name string) Logger
- func (l *Log) Printf(s string, i ...interface{})
- func (l *Log) Warnw(ctx context.Context, msg string, keysAndValues ...interface{})
- func (l *Log) With(args ...interface{}) Logger
- type Logger
- type TestLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AtomicLevel = zap.NewAtomicLevelAt(zapcore.InfoLevel)
)
Functions ¶
Types ¶
type Log ¶
type Log struct {
*zap.SugaredLogger
}
type Logger ¶
type Logger interface { Named(name string) Logger With(args ...interface{}) Logger Debugw(ctx context.Context, msg string, keysAndValues ...interface{}) Infow(ctx context.Context, msg string, keysAndValues ...interface{}) Infof(ctx context.Context, msg string, args ...interface{}) Warnw(ctx context.Context, msg string, keysAndValues ...interface{}) Errorw(ctx context.Context, err error, msg string, keysAndValues ...interface{}) error Printf(s string, i ...interface{}) }
type TestLogger ¶
TestLogger records output to internal Messages slice for later inspection. Use in your tests.
func NewTestLogger ¶
func NewTestLogger(tb testing.TB) *TestLogger
func (*TestLogger) AssertMessages ¶
func (t *TestLogger) AssertMessages(msgs ...string)
func (*TestLogger) Logf ¶
func (t *TestLogger) Logf(format string, args ...interface{})
Click to show internal directories.
Click to hide internal directories.