Documentation ¶
Overview ¶
Package clog is a convenience package for passing Zap loggers through contexts.
Index ¶
- func Check(ctx context.Context, lvl zapcore.Level, msg string) *zapcore.CheckedEntry
- func DPanic(ctx context.Context, msg string, fields ...zapcore.Field)
- func Debug(ctx context.Context, msg string, fields ...zapcore.Field)
- func Error(ctx context.Context, msg string, fields ...zapcore.Field)
- func Fatal(ctx context.Context, msg string, fields ...zapcore.Field)
- func Info(ctx context.Context, msg string, fields ...zapcore.Field)
- func Logger(ctx context.Context) (logger *zap.Logger)
- func Panic(ctx context.Context, msg string, fields ...zapcore.Field)
- func Sugar(ctx context.Context) *zap.SugaredLogger
- func Warn(ctx context.Context, msg string, fields ...zapcore.Field)
- func With(ctx context.Context, fields ...zapcore.Field) context.Context
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- func WithOptions(ctx context.Context, opts ...zap.Option) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sugar ¶
func Sugar(ctx context.Context) *zap.SugaredLogger
Sugar is a convenience function for calling Logger(ctx).Sugar().
func With ¶
With returns a context parented to ctx with a logger that has the given fields appended to it. The logger of ctx is the one returned by Logger.
func WithLogger ¶
WithLogger returns a context parented to ctx with the given logger attached as a value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.