xlog

package
v0.0.0-...-8af7e35 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(conf *Config) (log.Logger, func(), error)

Types

type Config

type Config struct {
	// 输出的文件夹
	OutputDir string
	// 输出的文件名
	OutputFilename string
	Level          log.Level
}

func (Config) ZapLevel

func (conf Config) ZapLevel() zapcore.Level

type Helper

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

Helper is a logger helper.

func NewHelper

func NewHelper(logger log.Logger) *Helper

NewHelper new a logger helper.

func (*Helper) Debugw

func (h *Helper) Debugw(msg string, keyvals ...interface{})

Debugw logs a message at debug level.

func (*Helper) Errorw

func (h *Helper) Errorw(msg string, keyvals ...interface{})

Errorw logs a message at error level.

func (*Helper) Infow

func (h *Helper) Infow(msg string, keyvals ...interface{})

Infow logs a message at info level.

func (*Helper) Log

func (h *Helper) Log(level log.Level, keyvals ...interface{})

Log Print log by level and keyvals.

func (*Helper) Warnw

func (h *Helper) Warnw(msg string, keyvals ...interface{})

Warnw logs a message at warnf level.

func (*Helper) With

func (h *Helper) With(kv ...interface{}) *Helper

With with logger fields.

func (*Helper) WithContext

func (h *Helper) WithContext(ctx context.Context) *Helper

WithContext returns a shallow copy of h with its context changed to ctx. The provided ctx must be non-nil.

type ZapLogger

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

ZapLogger implements the kratos.Logger

func (*ZapLogger) Log

func (z *ZapLogger) Log(level log.Level, keyvals ...interface{}) error

Jump to

Keyboard shortcuts

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