logy

package
v0.0.0-...-1272ae6 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZapSugaredLogger *zap.SugaredLogger

Functions

func Debug

func Debug(v ...interface{})

Debug

func Error

func Error(v ...interface{})

Error

func Info

func Info(v ...interface{})

Info

func InitLogger

func InitLogger(conf *LoggerConfig)

InitLogger 要写文件时,记得init此方法

func NewLogger

func NewLogger(filePath string, level zapcore.Level, maxSize int, maxBackups int, maxAge int, compress bool, serviceName string) *zap.SugaredLogger

eg: Admin项目启动 返回logger

func Panic

func Panic(v ...interface{})

func Trace

func Trace(v ...interface{})

Trace

Types

type LoggerConfig

type LoggerConfig struct {
	Path       string //文件目录
	FileName   string //文件名
	ToFile     bool   //是否保存到文件
	MaxDay     int    //最大保存天数
	SplitDay   int    //切割天数
	TimeFormat string //时间格式
}

LoggerConfig 日志配置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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