logger

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name        = "zap"
	DefaultPath = "log/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(ctx context.Context, msg string)
	Info(ctx context.Context, msg string)
	Warn(ctx context.Context, msg string)
	Error(ctx context.Context, msg string)
}

func GetLogger

func GetLogger(server_name string) Logger

type Option

type Option func(opt *ZapComponent)

func SetHooks

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

func WithConfig added in v1.5.0

func WithConfig(conf config.ConfigMate) Option

type ToyBoxLogger added in v1.5.1

type ToyBoxLogger interface {
	NewLogger(server_name string) Logger
}

func NewLogger added in v1.5.2

func NewLogger(conf config.ConfigMate) ToyBoxLogger

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 New

func New(opts ...Option) *ZapComponent

func (*ZapComponent) Name

func (zc *ZapComponent) Name() string

func (*ZapComponent) NewLogger added in v1.5.1

func (zc *ZapComponent) NewLogger(server_name string) Logger

Jump to

Keyboard shortcuts

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