logging

package
v0.0.0-...-7aa6a20 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(pretty bool, development bool, level zapcore.Level) *zap.Logger

func NewLogFile

func NewLogFile(path string) (*os.File, error)

func NewZapAccessLogger

func NewZapAccessLogger(syncer zapcore.WriteSyncer, development, pretty bool) *zap.Logger

func NewZapLogger

func NewZapLogger(syncer zapcore.WriteSyncer, pretty, development bool, level zapcore.Level) *zap.Logger

func NewZapLoggerWithCore

func NewZapLoggerWithCore(core zapcore.Core, development bool) *zap.Logger

func WithRequestID

func WithRequestID(reqID string) zap.Field

func WithTraceID

func WithTraceID(traceId string) zap.Field

func ZapJsonEncoder

func ZapJsonEncoder() zapcore.Encoder

func ZapLogLevelFromString

func ZapLogLevelFromString(logLevel string) (zapcore.Level, error)

Types

type BufferedLogger

type BufferedLogger struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewJSONZapBufferedLogger

func NewJSONZapBufferedLogger(options BufferedLoggerOptions) (*BufferedLogger, error)

func (*BufferedLogger) Close

func (f *BufferedLogger) Close() error

type BufferedLoggerOptions

type BufferedLoggerOptions struct {
	WS            *os.File
	BufferSize    int
	FlushInterval time.Duration
	Development   bool
	Level         zapcore.Level
	Pretty        bool
}

type RequestIDKey

type RequestIDKey struct{}

Jump to

Keyboard shortcuts

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