logutils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pkg = "logrusPkgPrint"
)

Variables

This section is empty.

Functions

func NowTimeFileLog

func NowTimeFileLog(path, name, begin string) (star string, file *os.File, err error)

NowTimeFileLog 创建日志文件 @param path 日志创建路径 @param name 日志文件名 @return star 生成日志文件的时间 @return file 日志文件 @return err 错误信息

Types

type FD

type FD interface {
	Fd() uintptr
}

type MultiFormatter

type MultiFormatter struct {
	Name, LogName                    string
	ColorFormatter, DefaultFormatter string
	// contains filtered or unexported fields
}

MultiFormatter logrus多格式输出工具

func NewMultiFormatter

func NewMultiFormatter(name string, writers ...io.Writer) *MultiFormatter

func (*MultiFormatter) Fire

func (format *MultiFormatter) Fire(entry *logrus.Entry) error

func (*MultiFormatter) Format

func (format *MultiFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format 自定义 log 格式

func (*MultiFormatter) Levels

func (format *MultiFormatter) Levels() []logrus.Level

func (*MultiFormatter) Write

func (format *MultiFormatter) Write(p []byte) (n int, err error)

type OutLog

type OutLog struct {
	Path      string // 存储目录
	LogName   string // 日志名称
	Size      int64  // 分割大小
	StartTime string // 开始写入日志的时间
	*os.File         // 当前日志输出文件
}

func NewOut

func NewOut(path, name string) *OutLog

func (*OutLog) Write

func (receiver *OutLog) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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