log

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Sugar 快捷方式

Functions

func Init

func Init()

Init 初始化日志

Types

type Config

type Config struct {
	FileName   string `mapstructure:"file_name"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	Level      string `mapstructure:"level"`
	SizeIncise bool   `mapstructrue:"size_incise"`
}

Config 日志配置信息

type Logger added in v0.1.0

type Logger struct {
	Sugar *zap.SugaredLogger
}

Logger 封装日志对象

func New added in v0.2.0

func New() *Logger

New 创建日志对象,单例

func (*Logger) Handle added in v0.2.0

func (l *Logger) Handle(ctx context.Context, err error)

Handle grpc error handler

func (*Logger) Log added in v0.2.0

func (l *Logger) Log(info ...interface{}) error

Log 实现 gokit 日志接口

Jump to

Keyboard shortcuts

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