logger

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Error

func Error(msg string)

func Info

func Info(msg string)

func Warn

func Warn(msg string)

func WithLogger

func WithLogger(opts ...Option) toybox.Option

Types

type Logger

type Logger struct {
	LoggerConfig
}

func GetLogger

func GetLogger(cfg ...LoggerConfig) *Logger

func New

func New(name, traceId string) *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Warn

func (l *Logger) Warn(msg string)

type LoggerConfig

type LoggerConfig struct {
	TraceId    string
	ServerName string
}

type Option

type Option func(*ZapComponent)

func SetHooks

func SetHooks(hooks ...(func(zapcore.Entry) error)) Option

type ZapComponent

type ZapComponent struct {
	Debug     string `toml:"debug"`
	Info      string `toml:"info"`
	Warn      string `toml:"warn"`
	Err       string `toml:"err"`
	MaxSize   int    `toml:"max_size"`
	MaxAge    int    `toml:"max_age"`
	MaxBackup int    `toml:"max_backup"`
	Compress  bool   `toml:"compress"`
	Json      bool   `toml:"json"`
	// contains filtered or unexported fields
}

func (*ZapComponent) Init

func (zc *ZapComponent) Init(ctx context.Context) (err error)

func (*ZapComponent) IsReady

func (zc *ZapComponent) IsReady()

func (*ZapComponent) Name

func (zc *ZapComponent) Name() string

func (*ZapComponent) Ready

func (zc *ZapComponent) Ready() bool

Jump to

Keyboard shortcuts

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