logger

package
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DebugLevel   = zapcore.DebugLevel
	InfoLevel    = zapcore.InfoLevel
	WarningLevel = zapcore.WarnLevel
	ErrorLevel   = zapcore.ErrorLevel
	FatalLevel   = zapcore.FatalLevel
)

Variables

This section is empty.

Functions

func ChiMiddleware added in v0.4.0

func ChiMiddleware() func(next http.Handler) http.Handler

func Flush

func Flush()

func FromContext

func FromContext(ctx context.Context, opts ...Option) *zap.Logger

func FromRequest

func FromRequest(req *http.Request, opts ...Option) *zap.Logger

func New

func New(opts ...Option) *zap.Logger

func SetLevel

func SetLevel(level Level)

Types

type Level

type Level = zapcore.Level

type Option

type Option func(options *Options)

func Decorate

func Decorate(fn func(string) string) Option

func Fields

func Fields(fields ...zap.Field) Option

func Named

func Named(name string) Option

func SkipCallFrame

func SkipCallFrame(count int) Option

type Options

type Options struct {
	SkipCallFrame   int
	Name            string
	NamingDecorator func(string) string
	Fields          []zap.Field
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL