logger

package
v0.15.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsoleEncode = "console"
)
View Source
const (
	RequestIDKey = "request_id"
)

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *Logger) context.Context

func InitLogger

func InitLogger(config Config)

func Sync

func Sync() error

Types

type Config

type Config struct {
	Level    string `json:"level"`
	Encoding string `json:"encoding"`
}

func DefaultConfig

func DefaultConfig() Config

type Field

type Field struct {
	Key   string
	Value interface{}
}

type Logger

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

func GetLoggerFromContext

func GetLoggerFromContext(ctx context.Context) *Logger

func NewLogger

func NewLogger(opts ...interface{}) *Logger

func (*Logger) DPanic

func (l *Logger) DPanic(msg string)

func (*Logger) DPanicf

func (l *Logger) DPanicf(template string, args ...interface{})

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Debugf

func (l *Logger) Debugf(template string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Errorf

func (l *Logger) Errorf(template string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(msg string)

func (*Logger) Fatalf

func (l *Logger) Fatalf(template string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Infof

func (l *Logger) Infof(template string, args ...interface{})

func (*Logger) IsDebugEnabled added in v0.15.1

func (l *Logger) IsDebugEnabled() bool

func (*Logger) Panic

func (l *Logger) Panic(msg string)

func (*Logger) Panicf

func (l *Logger) Panicf(template string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string)

func (*Logger) Warnf

func (l *Logger) Warnf(template string, args ...interface{})

func (*Logger) WithFields

func (l *Logger) WithFields(fields ...zap.Field) *Logger

Jump to

Keyboard shortcuts

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