log

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	XRequestIDKey = "X-Request-ID"
	XUsernameKey  = "X-Username"
)
View Source
var (
	MaxBackups = 3
)

Functions

func C

func C(ctx context.Context) *zapLogger

C Parse context.

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init(opts *Options)

func NewChannel

func NewChannel(c *Options) *zap.Logger

func NewLogger

func NewLogger(opts *Options) *zapLogger

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func Sync

func Sync()

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Types

type Logger

type Logger interface {
	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})
	Sync()
}

type Options

type Options struct {
	Level    string `mapstructure:"level" json:"level" yaml:"level"`
	Days     int    `mapstructure:"days" json:"days" yaml:"days"`
	Console  bool   `mapstructure:"console" json:"console" yaml:"console"`
	Format   string `mapstructure:"format" json:"format" yaml:"format"`
	MaxSize  int    `mapstructure:"maxSize" json:"maxSize" yaml:"maxSize"`
	Compress bool   `mapstructure:"compress" json:"compress" yaml:"compress"`
	Path     string `mapstructure:"path" json:"path" yaml:"path"`
}

func NewDefaultOptions

func NewDefaultOptions() *Options

Jump to

Keyboard shortcuts

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