log

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func ColorErr

func ColorErr(a ...interface{})

func ColorFErr

func ColorFErr(w io.Writer, a []interface{})

func ColorFInfo

func ColorFInfo(w io.Writer, a []interface{})

func ColorFInfof

func ColorFInfof(w io.Writer, format string, a []interface{})

func ColorInfo

func ColorInfo(a ...interface{})

func ColorInfof

func ColorInfof(format string, a ...interface{})

func InitLogger

func InitLogger(appName string, optionals Optionals)

初始化日志对象

func RandString

func RandString(n int) string

Types

type Optionals

type Optionals struct {
	// 日志文件路径, 如果为空则不写入文件
	FilePath string
	// 日志是否输出到终端中
	Console bool
	// elk logstash 地址, 如果为空则不写入elk
	LogStash string
}

type SysFormat

type SysFormat struct {
}

func (*SysFormat) Format

func (s *SysFormat) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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