zlog

package
v0.0.0-...-11d4248 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Log exlog
	Log *zap.Logger
	// Zlog exlog sugar
	Zlog *zap.SugaredLogger
)

Functions

func DPanic

func DPanic(f string, args ...interface{})

DPanic dpanic

func Debug

func Debug(f string, args ...interface{})

Debug debug

func Error

func Error(f string, args ...interface{})

Error error

func Fatal

func Fatal(f string, args ...interface{})

Fatal fatal

func Info

func Info(f string, args ...interface{})

Info info

func InitZlog

func InitZlog(cfg *Config)

InitZlog 初始化日志

func Panic

func Panic(f string, args ...interface{})

Panic panic

func Warn

func Warn(f string, args ...interface{})

Warn warn

Types

type Config

type Config struct {
	Simple      bool                              // 简易模式
	HookFunc    []func(entry zapcore.Entry) error // hook
	WriteLog    bool                              // 写日志
	WriteJSON   bool                              // json
	WriteConfig WriteConfig
	ServiceName string
}

Config 配置

type WriteConfig

type WriteConfig struct {
	LogPath    string // 日志路径
	MaxSize    int    // 日志大小
	MaxBackups int    // 备份
	MaxAge     int    // 天数
}

WriteConfig 写日志配置

Jump to

Keyboard shortcuts

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