centralog

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	IDKey string = "centralog_id"
)

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(conf zap.Config, serverAddr string) error

func InitLoggerWithOpt

func InitLoggerWithOpt(conf zap.Config, opts *LogOptions) error

func Sync

func Sync()

Types

type ChainLogger

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

func CtxDebug added in v1.1.1

func CtxDebug(ctx CtxProvider, msg string) *ChainLogger

func CtxError added in v1.1.1

func CtxError(ctx CtxProvider, msg string) *ChainLogger

func CtxInfo added in v1.1.1

func CtxInfo(ctx CtxProvider, msg string) *ChainLogger

func CtxWarn added in v1.1.1

func CtxWarn(ctx CtxProvider, msg string) *ChainLogger

func Debug

func Debug(msg string) *ChainLogger

func Error

func Error(msg string) *ChainLogger

func Info

func Info(msg string) *ChainLogger

func Warn

func Warn(msg string) *ChainLogger

func (*ChainLogger) Any

func (cl *ChainLogger) Any(key string, val interface{}) *ChainLogger

func (*ChainLogger) CtxID

func (cl *ChainLogger) CtxID(ctx context.Context) *ChainLogger

func (*ChainLogger) Log

func (cl *ChainLogger) Log()

type CtxProvider added in v1.1.1

type CtxProvider interface {
	context.Context
	Set(key string, value interface{})
	Get(key string) (value interface{}, exists bool)
	Iterate(func(key string, value interface{}))
}

type LogOptions

type LogOptions struct {
	Server     string
	Db         string // optional
	Collection string // optional
}

Jump to

Keyboard shortcuts

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