log

package
v0.0.0-...-6d5e59d Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *zap.Logger
	Sugar  *zap.SugaredLogger
)
View Source
var (
	KeyRequestID = "X-Request-ID"
)

Functions

func New

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

New create logger instance with options it can log into.

func WithRequestID

func WithRequestID(ctx context.Context) *zap.Logger

WithRequestID set requestID into log fields and return the log instance for chaining calls.

Types

type Option

type Option struct {
	Level     string `yaml:"level"`
	AccessLog string `yaml:"accessLog"`
	ErrorLog  string `yaml:"errorLog"`
	Console   bool   `yaml:"console"` // console or json
}

func (*Option) Valid

func (opts *Option) Valid() []error

Jump to

Keyboard shortcuts

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