standard

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field interface {
	// 布尔
	Bool(key string, val bool) Field
	// 字节数组
	ByteString(key string, val []byte) Field
	// 字符串
	String(key string, val string) Field
	// 整型(int64)
	Int64(key string, val int64) Field
	// 整型(uint32)
	Uint32(key string, val uint32) Field
	// 接口
	Reflect(key string, val interface{}) Field
	// 时长
	Duration(key string, val time.Duration) Field
	// context
	WithContext(context context.Context) Field
}

字段

type ILogger

type ILogger interface {
	// 普通信息
	Info(msg string, fields ...Field)
	// 调试信息
	Debug(msg string, fields ...Field)
	// 警告信息
	Warn(msg string, fields ...Field)
	// 错误信息
	Error(msg string, fields ...Field)
	//
	GetFields() Field
}

日志标准

type ILoggerc

type ILoggerc interface {
	ILogger
	// 普通信息
	Infoc(ctx context.Context, msg string, fields ...Field)
	// 调试信息
	Debugc(ctx context.Context, msg string, fields ...Field)
	// 警告信息
	Warnc(ctx context.Context, msg string, fields ...Field)
	// 错误信息
	Errorc(ctx context.Context, msg string, fields ...Field)
}

Jump to

Keyboard shortcuts

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