Documentation ¶
Index ¶
- func Debug(ctx context.Context, msg string, fields ...zap.Field)
- func Error(ctx context.Context, msg string, fields ...zap.Field)
- func Fatal(ctx context.Context, msg string, fields ...zap.Field)
- func From(ctx context.Context) *zap.Logger
- func HttpResponse(key string, response *http.Response) zap.Field
- func HttpResponseWithOpts(key string, response *http.Response, opts HttpResponseOptions) zap.Field
- func Info(ctx context.Context, msg string, fields ...zap.Field)
- func Initialize(opts ...Option) error
- func Panic(ctx context.Context, msg string, fields ...zap.Field)
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- func WithFields(ctx context.Context, fields ...zap.Field) context.Context
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- type HttpResponseOptions
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func From ¶
From return the zap.Logger from a context. If there is no configuration a default instance is returned.
func HttpResponse ¶
HttpResponse creates a Object fields that will output the response Status, StatusCode, ContentLength and Body.
func HttpResponseWithOpts ¶
HttpResponseWithOpts creates a Object fields that will output the response Status, StatusCode, ContentLength. The body will not be part of the output.
func Initialize ¶
Initialize intiializes the default configuration for the logger.
func WithFields ¶
WithFields returns a new context with the logger that includes the given fields.
Types ¶
type HttpResponseOptions ¶
type Option ¶
type Option = func(*options)
func WithContextKey ¶
WithContextKey is the option that initializes the default context key.
func WithDefaultLogger ¶
WithDefaultLogger is the option that initializes the default logger instance.