logger

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 8 Imported by: 25

README

logger

forked from go.uber.org/zap

添加日志文件写入

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug .

func Debugf

func Debugf(format string, params ...interface{})

Debugf .

func Error

func Error(v ...interface{})

Error .

func Errorf

func Errorf(format string, params ...interface{})

Errorf .

func Fatal

func Fatal(v ...interface{})

Fatal .

func Fatalf

func Fatalf(format string, params ...interface{})

Fatalf .

func Flush added in v1.1.6

func Flush()

Flush .

func Info

func Info(v ...interface{})

Info .

func Infof

func Infof(format string, params ...interface{})

Infof .

func SetDefault added in v1.0.2

func SetDefault(opts ...option)

SetDefault .

func Warn

func Warn(v ...interface{})

Warn .

func Warnf

func Warnf(format string, params ...interface{})

Warnf .

func WithCallerSkip added in v1.5.0

func WithCallerSkip(v int) option

WithCallerSkip .

func WithColorful added in v1.5.0

func WithColorful() option

WithColorful .

func WithContextHook added in v1.5.0

func WithContextHook(hook ContextHook) option

WithContextHook .

func WithMinLevel

func WithMinLevel(v string) option

WithMinLevel .

func WithName added in v1.5.0

func WithName(v string) option

WithName .

func WithWriter added in v1.1.3

func WithWriter(v io.Writer) option

WithWriter .

Types

type ContextHook added in v1.4.0

type ContextHook func(ctx context.Context) string

ContextHook return new Logger with context

type Logger

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

Logger .

func CallerSkip added in v1.3.0

func CallerSkip(skip int) *Logger

CallerSkip .

func Context added in v1.5.0

func Context(ctx context.Context) *Logger

Context .

func Named added in v1.1.7

func Named(name string) *Logger

Named .

func New

func New(opts ...option) *Logger

New .

func (*Logger) CallerSkip added in v1.3.0

func (log *Logger) CallerSkip(skip int) *Logger

CallerSkip 添加调用层

func (*Logger) Context added in v1.5.0

func (log *Logger) Context(ctx context.Context) *Logger

Context return new Logger with context

func (*Logger) Debug

func (log *Logger) Debug(v ...interface{})

Debug .

func (*Logger) Debugf

func (log *Logger) Debugf(format string, params ...interface{})

Debugf .

func (*Logger) Error

func (log *Logger) Error(v ...interface{})

Error .

func (*Logger) Errorf

func (log *Logger) Errorf(format string, params ...interface{})

Errorf .

func (*Logger) Fatal

func (log *Logger) Fatal(v ...interface{})

Fatal .

func (*Logger) Fatalf

func (log *Logger) Fatalf(format string, params ...interface{})

Fatalf .

func (*Logger) Flush added in v1.1.6

func (log *Logger) Flush()

Flush .

func (*Logger) Info

func (log *Logger) Info(v ...interface{})

Info .

func (*Logger) Infof

func (log *Logger) Infof(format string, params ...interface{})

Infof .

func (*Logger) Named added in v1.1.7

func (log *Logger) Named(name string) *Logger

Named 修改 name 注意:是修改,而不是 zap.Logger.Named() 的追加 name

func (*Logger) Warn

func (log *Logger) Warn(v ...interface{})

Warn .

func (*Logger) Warnf

func (log *Logger) Warnf(format string, params ...interface{})

Warnf .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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