log

package
v1.0.38 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RotateSignal = syscall.SIGUSR1
	OpenFlag     = os.O_CREATE | os.O_APPEND | os.O_WRONLY
	OpenPerm     = os.FileMode(0644)
)

Functions

func GetLogger added in v1.0.25

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

GetLogger retrieve the logger in context.

func MustNewCoreWithLevelAbove

func MustNewCoreWithLevelAbove(level zapcore.Level, location string, enc zapcore.Encoder) zapcore.Core

MustNewCoreWithLevelAbove create core handle level >= specified level

func MustNewCoreWithLevelOnly

func MustNewCoreWithLevelOnly(level zapcore.Level, location string, enc zapcore.Encoder) zapcore.Core

MustNewCoreWithLevelOnly create core only handle specified level

func NewSink

func NewSink(u *url.URL) (zap.Sink, error)

func ToContext added in v1.0.25

func ToContext(ctx context.Context, logger *zap.Logger) context.Context

ToContext adds the zap.Logger to the context for extraction later.

func With added in v1.0.25

func With(ctx context.Context, fields ...zapcore.Field) context.Context

With append logging fields to context

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(location string) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Sync

func (w *Writer) Sync() error

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Directories

Path Synopsis
encoders

Jump to

Keyboard shortcuts

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