log

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	String   = zap.String
	Bytes    = zap.ByteString
	Duration = zap.Duration

	Int8  = zap.Int8
	Int32 = zap.Int32
	Int   = zap.Int
	Int64 = zap.Int64

	Uint8  = zap.Uint8
	Uint32 = zap.Uint32
	Uint   = zap.Uint
	Uint64 = zap.Uint64

	Float64 = zap.Float64

	Any = zap.Any
)

Functions

func Debug

func Debug(ctx context.Context, msg string, fields ...Field)

func Debugf

func Debugf(msg string, fields ...Field)

func Error

func Error(ctx context.Context, msg string, fields ...Field)

func Errorf

func Errorf(msg string, fields ...Field)

func Info

func Info(ctx context.Context, msg string, fields ...Field)

func Infof

func Infof(msg string, fields ...Field)

func Panic

func Panic(ctx context.Context, msg string, fields ...Field)

func Panicf

func Panicf(msg string, fields ...Field)

func Warn

func Warn(ctx context.Context, msg string, fields ...Field)

func Warnf

func Warnf(msg string, fields ...Field)

Types

type Config

type Config struct {
	Dir   string
	Name  string
	Level string

	CallerSkip    int
	FlushInterval time.Duration

	Debug             bool
	WatchConfig       bool
	EnableAsyncLog    bool
	DisableStacktrace bool

	// 日志输出文件最大长度,超过改值则截断
	MaxSize   int
	MaxAge    int
	MaxBackup int
}

type Field

type Field = zap.Field

type Logger

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

func New

func New(config *Config) *Logger

func (*Logger) SetLevel

func (l *Logger) SetLevel(level string)

func (*Logger) Sync

func (l *Logger) Sync() error

Jump to

Keyboard shortcuts

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